summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Su <howard0su@gmail.com>2023-04-22 16:18:20 +0800
committerGitHub <noreply@github.com>2023-04-22 11:18:20 +0300
commit7e312f165c5047d6e16680d1eebc83055e95c313 (patch)
tree74e4365c5f6c99ce1db413c635468b5b63acf86c
parent872c365a9176a011b13d31269bb3121fa89c37e1 (diff)
cmake : fix build under Windows when enable BUILD_SHARED_LIBS (#1100)
* Fix build under Windows when enable BUILD_SHARED_LIBS * Make AVX512 test on Windows to build the shared libs
-rw-r--r--.github/workflows/build.yml2
-rw-r--r--CMakeLists.txt4
2 files changed, 5 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7e8a29b1..b2a35613 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -169,7 +169,7 @@ jobs:
- build: 'avx'
defines: '-DLLAMA_AVX2=OFF'
- build: 'avx512'
- defines: '-DLLAMA_AVX512=ON'
+ defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
steps:
- name: Clone
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c3c6016..2d4e30e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,6 +201,10 @@ endif()
if (MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
+
+ if (BUILD_SHARED_LIBS)
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+ endif()
endif()
if (LLAMA_LTO)