Skip to content

Commit

Permalink
update dylib postfix
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Sep 14, 2024
1 parent 2ea8867 commit f967d41
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
38 changes: 22 additions & 16 deletions cpp/wedpr-transport/sdk-wrapper/java/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
file(GLOB_RECURSE SRCS wedpr_java_transport.i)
set_source_files_properties(${SRCS} PROPERTIES CPLUSPLUS ON)

set(WEDPR_TRANSPORT_PACKAGE "com.webank.wedpr.sdk.jni.generated")

set_property(SOURCE swig/wedpr_java_transport.i PROPERTY COMPILE_OPTIONS
-package ${WEDPR_TRANSPORT_PACKAGE})

file(MAKE_DIRECTORY ${WEDPR_JAVA_TRANSPORT_DIR})
file(MAKE_DIRECTORY ${WEDPR_JAVA_TRANSPORT_LIB_DIR})

swig_add_library(${WEDPR_JAVA_TRANSPORT}
TYPE MODULE
LANGUAGE java
OUTPUT_DIR ${WEDPR_JAVA_TRANSPORT_DIR}
SOURCES ${SRCS})
option(AUTO_GENERATE "Auto generate the targes" OFF)
if(AUTO_GENERATE)
file(GLOB_RECURSE SRCS wedpr_java_transport.i)
set_source_files_properties(${SRCS} PROPERTIES CPLUSPLUS ON)

set(WEDPR_TRANSPORT_PACKAGE "com.webank.wedpr.sdk.jni.generated")

set_property(SOURCE swig/wedpr_java_transport.i PROPERTY COMPILE_OPTIONS
-package ${WEDPR_TRANSPORT_PACKAGE})

file(MAKE_DIRECTORY ${WEDPR_JAVA_TRANSPORT_DIR})
file(MAKE_DIRECTORY ${WEDPR_JAVA_TRANSPORT_LIB_DIR})

swig_add_library(${WEDPR_JAVA_TRANSPORT}
TYPE MODULE
LANGUAGE java
OUTPUT_DIR ${WEDPR_JAVA_TRANSPORT_DIR}
SOURCES ${SRCS})
else()
file(GLOB_RECURSE SRCS src/*.cxx)
add_library(${WEDPR_JAVA_TRANSPORT} SHARED ${SRCS})
endif()

SET(LIBRARY_OUTPUT_PATH ${WEDPR_JAVA_TRANSPORT_LIB_DIR})
message("LIBRARY_OUTPUT_PATH: ${WEDPR_JAVA_TRANSPORT_LIB_DIR}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ public static String getLibName(String baseName) {
} else if (osName.contains(MAC)) {
String arch = getArch();
if ("arm".equals(arch)) {
return "lib" + baseName + "-aarch64" + ".jnilib";
return "lib" + baseName + "-aarch64" + ".dylib";
}
return "lib" + baseName + ".jnilib";
return "lib" + baseName + ".dylib";
} else {
throw new RuntimeException("unrecognized OS: " + osName);
}
Expand Down

0 comments on commit f967d41

Please sign in to comment.