Skip to content

Commit 7e312f1

Browse files
authored
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
1 parent 872c365 commit 7e312f1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169
- build: 'avx'
170170
defines: '-DLLAMA_AVX2=OFF'
171171
- build: 'avx512'
172-
defines: '-DLLAMA_AVX512=ON'
172+
defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
173173

174174
steps:
175175
- name: Clone

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ endif()
201201

202202
if (MSVC)
203203
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
204+
205+
if (BUILD_SHARED_LIBS)
206+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
207+
endif()
204208
endif()
205209

206210
if (LLAMA_LTO)

0 commit comments

Comments
 (0)