]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : fix linkage with mingw (#551)
authoranzz1 <redacted>
Tue, 28 Mar 2023 18:23:09 +0000 (21:23 +0300)
committerGitHub <redacted>
Tue, 28 Mar 2023 18:23:09 +0000 (21:23 +0300)
* Revert 7e53955 (#542)

Still needs to be fixed properly

* Fix linking on mingw32

examples/embedding/CMakeLists.txt
examples/main/CMakeLists.txt
examples/perplexity/CMakeLists.txt
examples/quantize/CMakeLists.txt
llama.h

index def5b831bbe4ab946a5dc1d83ff0311a31aeef8a..88c425d4a1fd1d585307cad78122d6e34a762bd0 100644 (file)
@@ -1,4 +1,4 @@
 set(TARGET embedding)
 add_executable(${TARGET} embedding.cpp)
-target_link_libraries(${TARGET} PRIVATE common llama ggml ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
 target_compile_features(${TARGET} PRIVATE cxx_std_11)
index aa1f79406d1c5937052e5753460a42b3a816f84f..b2dcc2910f3336647b45120cabb2c01255089916 100644 (file)
@@ -1,4 +1,4 @@
 set(TARGET main)
 add_executable(${TARGET} main.cpp)
-target_link_libraries(${TARGET} PRIVATE common llama ggml ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
 target_compile_features(${TARGET} PRIVATE cxx_std_11)
index 9bd8e376f548f088ff753b43fbce701115b15938..5836df8b277525d600a4fece6faa85e84d1f8120 100644 (file)
@@ -1,4 +1,4 @@
 set(TARGET perplexity)
 add_executable(${TARGET} perplexity.cpp)
-target_link_libraries(${TARGET} PRIVATE common llama ggml ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
 target_compile_features(${TARGET} PRIVATE cxx_std_11)
index 17a995bbd74cc3ecb50e8191f5cabbb6ac9745cd..fb27d45171c7a9f1cfaaf1f8467baa2b79cbac78 100644 (file)
@@ -1,4 +1,4 @@
 set(TARGET quantize)
 add_executable(${TARGET} quantize.cpp)
-target_link_libraries(${TARGET} PRIVATE llama ggml ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} PRIVATE llama ${CMAKE_THREAD_LIBS_INIT})
 target_compile_features(${TARGET} PRIVATE cxx_std_11)
diff --git a/llama.h b/llama.h
index f5a576c1e19067329787377b120c554496445d0c..587d85323cbc3d3a4dc6ae8d1a1431f621be6e67 100644 (file)
--- a/llama.h
+++ b/llama.h
@@ -6,7 +6,7 @@
 #include <stdbool.h>
 
 #ifdef LLAMA_SHARED
-#    ifdef _WIN32
+#    ifdef _WIN32 && !defined __MINGW32__
 #        ifdef LLAMA_BUILD
 #            define LLAMA_API __declspec(dllexport)
 #        else