From 0626417687c8426252b72b912c531b3ee45e41d3 Mon Sep 17 00:00:00 2001 From: Howard Su Date: Fri, 21 Apr 2023 21:19:02 +0800 Subject: [PATCH] Fix build under Windows when enable BUILD_SHARED_LIBS --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f9fdd30f..3e9f68928 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)