[CDRIVER-1950] CMake build should use BUILD_SHARED_LIBS=OFF to disable building of shared libraries Created: 09/Dec/16  Updated: 03/May/17  Resolved: 29/Mar/17

Status: Closed
Project: C Driver
Component/s: Build
Affects Version/s: 1.5.0
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Jonathan Wang Assignee: A. Jesse Jiryu Davis
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all


Issue Links:
Related
related to CDRIVER-1948 CMake build should allow using bundle... Closed

 Description   

See CXX-957. BUILD_SHARED_LIBS=OFF for the CMake build currently does not do anything, and there is no way to control the building of shared libraries with CMake.



 Comments   
Comment by A. Jesse Jiryu Davis [ 29/Mar/17 ]

The justification for this was that a user who specifies a link line like "-lmongoc-1.0" has trouble choosing static linking, if both shared and static libraries are installed. The approach we took instead with CDRIVER-2074 is to name the static libraries differently like "libmongoc-static-1.0.a". Now you can choose static linking with "-lmongoc-static-1.0".

Comment by Andrew Morrow (Inactive) [ 19/Dec/16 ]

Note that the C++ driver build approach to this is to still build shared libraries even if BUILD_SHARED_LIBS=OFF, but to avoid installing them. The end user observable effects are more or less the same. This makes it easier to write the CMakeLists.txt files without needing to condition on BUILD_SHARED_LIBS all over the place.

Comment by Jonathan Wang [ 09/Dec/16 ]

This request is not urgent. It would be nice only for the purpose of getting the behavior and features of the CMake build consistent with the configure build.

Comment by A. Jesse Jiryu Davis [ 09/Dec/16 ]

Thanks for the report, can you tell us about the urgency of your request?

Generated at Wed Feb 07 21:13:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.