aboutsummaryrefslogtreecommitdiff
path: root/ports/mongo-cxx-driver/disable_shared.patch
diff options
context:
space:
mode:
authorsdcb <sdflysha@qq.com>2016-11-22 15:33:24 +0800
committersdcb <sdflysha@qq.com>2016-11-22 15:33:24 +0800
commit9d3a91cce2d9a437ca508b9400c9f0b005f90231 (patch)
treee371fcbf862c02a838947eab2a5ad56c489cdda5 /ports/mongo-cxx-driver/disable_shared.patch
parent891fe4434cc670aba2a82ed2cdcfb3fe30e0f93c (diff)
downloadvcpkg-9d3a91cce2d9a437ca508b9400c9f0b005f90231.tar.gz
vcpkg-9d3a91cce2d9a437ca508b9400c9f0b005f90231.zip
[mongo-cxx-driver] fix static build
note: Actually, static build is perfectly fine but the cmake always build static and dynamic library togather, in the static environment, dynamic build will fail due link error. I twisted a patch to the CMakeLists.txt to make dynamic build happy when building static.
Diffstat (limited to 'ports/mongo-cxx-driver/disable_shared.patch')
-rw-r--r--ports/mongo-cxx-driver/disable_shared.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/ports/mongo-cxx-driver/disable_shared.patch b/ports/mongo-cxx-driver/disable_shared.patch
new file mode 100644
index 000000000..46a258326
--- /dev/null
+++ b/ports/mongo-cxx-driver/disable_shared.patch
@@ -0,0 +1,46 @@
+diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt
+index a9a7ada..f4534b1 100644
+--- a/src/bsoncxx/CMakeLists.txt
++++ b/src/bsoncxx/CMakeLists.txt
+@@ -117,9 +117,15 @@ if (WIN32)
+ )
+ endif()
+
+-add_library(bsoncxx SHARED
+- ${bsoncxx_sources}
+-)
++if(ENABLE_SHARED)
++ add_library(bsoncxx SHARED
++ ${bsoncxx_sources}
++ )
++else()
++ add_library(bsoncxx SHARED
++ exception/error_code.cpp
++ )
++endif()
+
+ set(bsoncxx_libs ${LIBBSON_LIBRARIES})
+
+diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt
+index 2ef54e4..a2c8ca4 100644
+--- a/src/mongocxx/CMakeLists.txt
++++ b/src/mongocxx/CMakeLists.txt
+@@ -134,9 +134,15 @@ set_target_properties(mongocxx_mocked PROPERTIES
+ VERSION ${MONGOCXX_VERSION}
+ )
+
+-add_library(mongocxx SHARED
+- ${mongocxx_sources}
+-)
++if(ENABLE_SHARED)
++ add_library(mongocxx SHARED
++ ${mongocxx_sources}
++ )
++else()
++ add_library(mongocxx SHARED
++ exception/error_code.cpp
++ )
++endif()
+
+ set_target_properties (mongocxx PROPERTIES
+ OUTPUT_NAME mongocxx