Skip to content

Commit

Permalink
arch
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Mühleisen committed Apr 29, 2024
1 parent f9b28dd commit ae3c065
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build
build
.idea
cmake-build-debug
29 changes: 24 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,32 @@ add_library(duckdb_java SHARED src/jni/duckdb_java.cpp src/jni/functions.cpp ${D
target_compile_options(duckdb_java PRIVATE -fexceptions)
target_link_libraries(duckdb_java duckdb-native )



set(OS_NAME "unknown")
set(OS_ARCH "amd64")

string(REGEX MATCH "(arm64|aarch64)" IS_ARM "${CMAKE_SYSTEM_PROCESSOR}")
if(IS_ARM)
set(OS_ARCH "arm64")
elseif(FORCE_32_BIT)
set(OS_ARCH "i386")
endif()

if(APPLE)
set(OS_NAME osx)
set(OS_ARCH universal)
set(OS_NAME "osx")
endif()
#if(OVERRIDE_JDBC_OS_ARCH)
# set(OS_ARCH ${OVERRIDE_JDBC_OS_ARCH})
#endif()
if(WIN32)
set(OS_NAME "windows")
endif()
if(UNIX AND NOT APPLE)
set(OS_NAME "linux") # sorry BSD
endif()

if(OVERRIDE_JDBC_OS_ARCH)
set(OS_ARCH ${OVERRIDE_JDBC_OS_ARCH})
endif()

string(JOIN "_" LIB_SUFFIX ".so" ${OS_NAME} ${OS_ARCH})
set_target_properties(duckdb_java PROPERTIES SUFFIX ${LIB_SUFFIX})
set_target_properties(duckdb_java PROPERTIES PREFIX "lib")
Expand Down
29 changes: 24 additions & 5 deletions CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,32 @@ add_library(duckdb_java SHARED src/jni/duckdb_java.cpp src/jni/functions.cpp ${D
target_compile_options(duckdb_java PRIVATE -fexceptions)
target_link_libraries(duckdb_java duckdb-native ${LIBRARY_FILES})



set(OS_NAME "unknown")
set(OS_ARCH "amd64")

string(REGEX MATCH "(arm64|aarch64)" IS_ARM "${CMAKE_SYSTEM_PROCESSOR}")
if(IS_ARM)
set(OS_ARCH "arm64")
elseif(FORCE_32_BIT)
set(OS_ARCH "i386")
endif()

if(APPLE)
set(OS_NAME osx)
set(OS_ARCH universal)
set(OS_NAME "osx")
endif()
#if(OVERRIDE_JDBC_OS_ARCH)
# set(OS_ARCH ${OVERRIDE_JDBC_OS_ARCH})
#endif()
if(WIN32)
set(OS_NAME "windows")
endif()
if(UNIX AND NOT APPLE)
set(OS_NAME "linux") # sorry BSD
endif()

if(OVERRIDE_JDBC_OS_ARCH)
set(OS_ARCH ${OVERRIDE_JDBC_OS_ARCH})
endif()

string(JOIN "_" LIB_SUFFIX ".so" ${OS_NAME} ${OS_ARCH})
set_target_properties(duckdb_java PROPERTIES SUFFIX ${LIB_SUFFIX})
set_target_properties(duckdb_java PROPERTIES PREFIX "lib")
Expand Down

0 comments on commit ae3c065

Please sign in to comment.