define MONGOCXX_STATIC in export.hpp

This commit is contained in:
sdcb 2016-11-22 16:27:42 +08:00
parent 9d3a91cce2
commit db2b51c06a
2 changed files with 19 additions and 0 deletions

View File

@ -76,6 +76,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(RENAME file(RENAME
${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib
${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib)
# define MONGOCXX_STATIC in config/export.hpp
vcpkg_apply_patches(
SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
PATCHES
${CMAKE_CURRENT_LIST_DIR}/static.patch
)
else() else()
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib)

View File

@ -0,0 +1,12 @@
diff --git a/mongocxx/config/export.hpp b/mongocxx/config/export.hpp
index 61a3e74..7fc951c 100644
--- a/mongocxx/config/export.hpp
+++ b/mongocxx/config/export.hpp
@@ -2,6 +2,7 @@
#ifndef MONGOCXX_API_H
#define MONGOCXX_API_H
+#define MONGOCXX_STATIC
#ifdef MONGOCXX_STATIC
# define MONGOCXX_API
# define MONGOCXX_PRIVATE