]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cmake : fix build under Windows when enable BUILD_SHARED_LIBS (#1100)
authorHoward Su <redacted>
Sat, 22 Apr 2023 08:18:20 +0000 (16:18 +0800)
committerGitHub <redacted>
Sat, 22 Apr 2023 08:18:20 +0000 (11:18 +0300)
* Fix build under Windows when enable BUILD_SHARED_LIBS

* Make AVX512 test on Windows to build the shared libs

.github/workflows/build.yml
CMakeLists.txt

index 7e8a29b1e5faef83dd8e1a11b6cf68c77e54c5c4..b2a35613e04b3786efb9ebd8b02f1fa6a5d11818 100644 (file)
@@ -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
index 2c3c60167fc5b75d15a4936e7ebf4c8b49f6bb2d..2d4e30e5a2dea9861cfd8ef7f4d8e9ce23de1339 100644 (file)
@@ -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)