Skip to content

Commit

Permalink
Add macOS support for Java remote modules
Browse files Browse the repository at this point in the history
  • Loading branch information
damonbarry committed Apr 12, 2017
1 parent c1bdd68 commit 24353a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 7 additions & 1 deletion jenkins/osx_c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ script_dir=$(cd "$(dirname "$0")" && pwd)
build_root=$(cd "${script_dir}/.." && pwd)
build_folder=$build_root"/build"

CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
CORES=$(sysctl -n hw.ncpu)

# Java binding
pushd $build_root/bindings/java/gateway-java-binding
mvn clean install
popd

# Java proxy gateway
pushd $build_root/proxy/gateway/java/gateway-remote-module
mvn clean install
popd

rm -rf $build_folder
mkdir -p $build_folder
pushd $build_folder
Expand All @@ -26,6 +31,7 @@ cmake \
-Dbuild_cores=$CORES \
-Denable_ble_module:BOOL=OFF \
-Denable_java_binding=ON \
-Denable_java_remote_modules:BOOL=ON \
-Drun_unittests:BOOL=ON \
-Drun_e2e_tests:BOOL=ON \
..
Expand Down
15 changes: 11 additions & 4 deletions proxy/gateway/java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ set(java_nanomsg_headers
./nanomsg-binding/java_nanomsg.h
)

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LINUX TRUE)
endif()

if(WIN32)
set(java_include_dirs
$ENV{JAVA_HOME}/include
Expand All @@ -57,6 +53,17 @@ elseif(LINUX)
set(java_libs
$ENV{JAVA_HOME}/jre/lib/${JDK_ARCH}/server/libjvm.so
)
elseif(APPLE)
set(java_include_dirs
$ENV{JAVA_HOME}/include
$ENV{JAVA_HOME}/include/darwin
)
set(java_link_dirs
$ENV{JAVA_HOME}/jre/lib/server
)
set(java_libs
$ENV{JAVA_HOME}/jre/lib/server/libjvm.dylib
)
endif()

if(
Expand Down
1 change: 0 additions & 1 deletion proxy/gateway/java/nanomsg-binding/java_nanomsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ JNIEXPORT jstring JNICALL Java_com_microsoft_azure_gateway_remote_NanomsgLibrary
jthrowable exception = (*env)->ExceptionOccurred(env);
if (error_msg == NULL || exception)
{
error_msg = "";
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}
Expand Down

0 comments on commit 24353a7

Please sign in to comment.