mirror of
https://github.com/cemu-project/vcpkg.git
synced 2024-12-11 21:03:45 +00:00
Fix static build runtime error.
This commit is contained in:
parent
2538bdac5a
commit
51a9334d1b
@ -30,6 +30,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib)
|
||||
|
||||
# drop the __declspec(dllimport) when building static
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
|
||||
PATCHES
|
||||
${CMAKE_CURRENT_LIST_DIR}/static.patch
|
||||
)
|
||||
else()
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib)
|
||||
|
13
ports/libbson/static.patch
Normal file
13
ports/libbson/static.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/bson-macros.h b/bson-macros.h
|
||||
index 909bf6c..0a1f612 100644
|
||||
--- a/bson-macros.h
|
||||
+++ b/bson-macros.h
|
||||
@@ -69,7 +69,7 @@
|
||||
# ifdef BSON_COMPILATION
|
||||
# define BSON_API __declspec(dllexport)
|
||||
# else
|
||||
-# define BSON_API __declspec(dllimport)
|
||||
+# define BSON_API
|
||||
# endif
|
||||
#elif defined(__GNUC__)
|
||||
# define BSON_API __attribute__ ((visibility ("default")))
|
Loading…
Reference in New Issue
Block a user