[CXX-1313] "bsoncxx" depends on "bson-1.0" if BUILD_SHARED_LIBS, else depends on "bson-static-1.0" Created: 12/Apr/17  Updated: 19/Apr/17  Resolved: 14/Apr/17

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: New Feature Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: static-linking

 Description   

Currently, both the "bsoncxx" and "bsoncxx_static" targets depend on the "bson-1.0" library, which is the shared libbson library.

We should remove the "bsoncxx_static" target, and make the "bsoncxx" target a shared or static library depending on the user value for BUILD_SHARED_LIBS. If BUILD_SHARED_LIBS is on, "bsoncxx" should depend on "bson-1.0"; else, if should depend on "bson-static-1.0".

This has the effect of limiting users to building either the static library or the shared library, but not both at once.



 Comments   
Comment by J Rassi [ 19/Apr/17 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1313 Library variables in cmake config files should use abs paths
Branch: CXX-1257-revise-static-linking
https://github.com/mongodb/mongo-cxx-driver/commit/e44c479a89efb2e8503763e6b7e3d1ad444fd580

Comment by J Rassi [ 14/Apr/17 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1313 Create testing-only copy of bsoncxx that exports some private functionality for testing
Branch: CXX-1257-revise-static-linking
https://github.com/mongodb/mongo-cxx-driver/commit/db0f02e5f7da75b70320aff3f7cdf07627d3c5c1

Comment by J Rassi [ 14/Apr/17 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1313 bsoncxx links static/dyn libbson depending on BUILD_SHARED_LIBS

BUILD_SHARED_LIBS=ON now disables the static library build.
Branch: CXX-1257-revise-static-linking
https://github.com/mongodb/mongo-cxx-driver/commit/e5a8228ddbdb71771ee7d4b98aeca64e51880465

Generated at Wed Feb 07 22:02:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.