diff --git a/features/com.minres.scviewer.database.feature/feature.xml b/features/com.minres.scviewer.database.feature/feature.xml index 0aa2e38..ae4b446 100644 --- a/features/com.minres.scviewer.database.feature/feature.xml +++ b/features/com.minres.scviewer.database.feature/feature.xml @@ -77,4 +77,11 @@ http://www.eclipse.org/legal/epl-v10.html version="0.0.0" unpack="false"/> + + diff --git a/plugins/com.minres.scviewer.database.fst/build.properties b/plugins/com.minres.scviewer.database.fst/build.properties index 36acffb..cede501 100644 --- a/plugins/com.minres.scviewer.database.fst/build.properties +++ b/plugins/com.minres.scviewer.database.fst/build.properties @@ -5,4 +5,5 @@ bin.includes = META-INF/,\ lib/jna-5.13.0.jar,\ lib/jna-jpms-5.13.0.jar,\ linux-x86-64/,\ + win32-x86-64/,\ OSGI-INF/ diff --git a/plugins/com.minres.scviewer.database.fst/csrc/fst/CMakeLists.txt b/plugins/com.minres.scviewer.database.fst/csrc/fst/CMakeLists.txt index 0f1e669..a658245 100644 --- a/plugins/com.minres.scviewer.database.fst/csrc/fst/CMakeLists.txt +++ b/plugins/com.minres.scviewer.database.fst/csrc/fst/CMakeLists.txt @@ -3,11 +3,24 @@ cmake_minimum_required (VERSION 3.0) project (fstlib VERSION 1.0.0) set(BUILD_SHARED_LIBS ON) -find_package(ZLIB REQUIRED) +#find_package(ZLIB REQUIRED) +include(FetchContent) +FetchContent_Declare( + zlib + URL https://www.zlib.net/zlib-1.2.13.tar.gz + https://www.zlib.net/fossils/zlib-1.2.13.tar.gz + https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz + URL_HASH MD5=9b8aa094c4e5765dabf4da391f00d15c +) +FetchContent_Populate(zlib) +add_subdirectory(${zlib_SOURCE_DIR} ${zlib_BINARY_DIR} EXCLUDE_FROM_ALL) +add_library(ZLIB::ZLIB ALIAS zlibstatic) +target_include_directories(zlibstatic INTERFACE ${zlib_BINARY_DIR} ${zlib_SOURCE_DIR}) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) add_library(fstapi fstapi.c lz4.c fastlz.c fst_helper.c) -target_include_directories(fstapi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) -target_link_libraries(fstapi PRIVATE ${ZLIB_LIBRARIES}) +#target_include_directories(fstapi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) +target_link_libraries(fstapi PRIVATE zlibstatic) # hack to avoid creating dummy config.h target_compile_definitions(fstapi PRIVATE -DFST_CONFIG_INCLUDE="fstapi.h") @@ -18,4 +31,5 @@ if(MSVC) endif() install(TARGETS fstapi - LIBRARY DESTINATION .) + LIBRARY DESTINATION . + RUNTIME DESTINATION .) diff --git a/plugins/com.minres.scviewer.database.fst/csrc/fst/build.cmd b/plugins/com.minres.scviewer.database.fst/csrc/fst/build.cmd new file mode 100644 index 0000000..3828461 --- /dev/null +++ b/plugins/com.minres.scviewer.database.fst/csrc/fst/build.cmd @@ -0,0 +1,2 @@ +cmake -B build -S . -DCMAKE_INSTALL_PREFIX=../../win32-x86-64 +cmake --build build --target install --config Release diff --git a/plugins/com.minres.scviewer.database.fst/csrc/fst/build.sh b/plugins/com.minres.scviewer.database.fst/csrc/fst/build.sh index 4d26b06..8de0e7f 100644 --- a/plugins/com.minres.scviewer.database.fst/csrc/fst/build.sh +++ b/plugins/com.minres.scviewer.database.fst/csrc/fst/build.sh @@ -1,2 +1,2 @@ -cmake -B build -S . -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=../../linux-x86-64 +cmake -B build -S . -DCMAKE_INSTALL_PREFIX=../../linux-x86-64 -DCMAKE_BUILD_TYPE=Release cmake --build build --target install diff --git a/plugins/com.minres.scviewer.database.fst/win32-x86-64/fstapi.dll b/plugins/com.minres.scviewer.database.fst/win32-x86-64/fstapi.dll new file mode 100644 index 0000000..02d7837 Binary files /dev/null and b/plugins/com.minres.scviewer.database.fst/win32-x86-64/fstapi.dll differ