[CXX-957] Allow a user to decide whether to build static or shared libraries Created: 24/Jun/16 Updated: 29/Nov/16 Resolved: 19/Oct/16 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Build |
| Affects Version/s: | 3.0.1 |
| Fix Version/s: | 3.1.0 |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Jonathan Wang | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux/Unix |
||
| Description |
|
Currently, both the static and shared libraries are built when configuring and compiling with CMake. Usually, projects will allow you to specify whether you want to build the static or shared library, or both. For example, with autoconf, the configure script allows you to specify the flags --enable-static, --enable-shared, --disable-static, or --disable-shared. Similarly, CMake has a standard option, BUILD_SHARED_LIBS, which is usually specified during the configuration step, e.g. cmake -DBUILD_SHARED_LIBS=ON ... It would be useful the user could decide whether to build the C++ driver as a shared or static library. Sometimes it is useful to have only the static libraries installed. For example, when both the dynamic and static libraries are installed, a linker flag such as -lmongocxx will automatically choose the dynamic library. The only way to specify the static library in this case is to provide the full path to the static library instead of the flag with just the library name. This is not a major issue because the dynamic libraries can simply be removed after the installation step is complete. However, it would be nice if you could decide at configuration time which libraries (dynamic or static) you wanted to build so as to avoid unnecessary build steps. |
| Comments |
| Comment by Githook User [ 29/Nov/16 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}Message: |
| Comment by David Golden [ 19/Oct/16 ] |
|
Ticket was automatically moved to "Needs Triage" when the legacy "Resolved" status was deleted from our workflow template. Moving to Closed status instead. |
| Comment by Andrew Morrow (Inactive) [ 10/Sep/16 ] |
|
Resolved by commit https://github.com/mongodb/mongo-cxx-driver/commit/f4a8e108a4b61558a5cc49e69d322428846d5fe3 |
| Comment by Andrew Morrow (Inactive) [ 08/Sep/16 ] |
| Comment by Andrew Morrow (Inactive) [ 24/Jun/16 ] |
|
Thanks, this is a good suggestion. We are planning some CMake work for the 3.1.0 release, so I will schedule this there. |