summaryrefslogtreecommitdiff
path: root/java/CMakeLists.txt
diff options
context:
space:
mode:
authorGrant Limberg <glimberg@gmail.com>2015-05-04 20:04:44 -0700
committerGrant Limberg <glimberg@gmail.com>2015-05-04 20:04:44 -0700
commite28712555d87c10965a8dcd46da6800a4f2e6326 (patch)
tree5a78e2de69ee8f7271102fa3de36e8a71c561c7f /java/CMakeLists.txt
parentaf66f14761c086e1ca4c2255619f80b918d3f713 (diff)
downloadinfinitytier-e28712555d87c10965a8dcd46da6800a4f2e6326.tar.gz
infinitytier-e28712555d87c10965a8dcd46da6800a4f2e6326.zip
build & package libZeroTierOneSDK.jnilib on Mac oS
Signed-off-by: Grant Limberg <glimberg@gmail.com>
Diffstat (limited to 'java/CMakeLists.txt')
-rw-r--r--java/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index 81345f1d..9c06ce45 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -5,7 +5,13 @@ project(ZeroTierOneJNI)
find_package(Java COMPONENTS Development)
message("JAVA_HOME: $ENV{JAVA_HOME}")
+if(WIN32)
set(Java_INCLUDE_DIRS $ENV{JAVA_HOME}/include)
+endif()
+
+if(APPLE)
+set(Java_INCLUDE_DIRS "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/JavaVM.framework/Headers")
+endif()
message("Java Include Dirs: ${Java_INCLUDE_DIRS}")
@@ -14,6 +20,11 @@ if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /MP")
endif()
+if(APPLE)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386 -arch x86_64 -Wall -O3 -flto -fPIE -fvectorize -fstack-protector -mmacosx-version-min=10.7 -Wno-unused-private-field")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -fno-rtti")
+endif()
+
set(src_files
../ext/lz4/lz4.c
../ext/json-parser/json.c
@@ -62,6 +73,8 @@ include_directories(
add_library(${PROJECT_NAME} SHARED ${src_files})
+set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".jnilib")
+
set(link_libs )
if(WIN32)