From: Howard Su Date: Sat, 22 Apr 2023 08:18:20 +0000 (+0800) Subject: cmake : fix build under Windows when enable BUILD_SHARED_LIBS (#1100) X-Git-Tag: gguf-v0.4.0~894 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7e312f165c5047d6e16680d1eebc83055e95c313;p=pkg%2Fggml%2Fsources%2Fllama.cpp 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 --- 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)