[CDRIVER-4784] Disable shared libmongoc targets if `ENABLE_SHARED=OFF` Created: 16/Nov/23  Updated: 07/Dec/23  Resolved: 06/Dec/23

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

Type: Bug Priority: Unknown
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-4705 Better control over static/dynamic co... Closed

 Description   

Scope

Disable shared libmongoc targets if the CMake option ENABLE_SHARED is OFF

Background and motivation

CDRIVER-4705 adds a ENABLE_SHARED option. If OFF, building shared libbson targets is disabled. This is not yet applied to libmongoc.

This may result simplifying the vcpkg port. The port currently includes a patch to disable the shared library build when the static library is built:
https://github.com/microsoft/vcpkg/blob/ac2a14f35fcd57d7a38f09af75dd5258e96dd6ac/ports/libbson/disable-dynamic-when-static.patch

IIUC vcpkg expects only shared or static libraries are built (but not both). Refer:
https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#choose-either-static-or-shared-binaries



 Comments   
Comment by Githook User [ 06/Dec/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4784 Disable shared libmongoc targets if `ENABLE_SHARED=OFF` (#1486)
Branch: r1.25
https://github.com/mongodb/mongo-c-driver/commit/d9940cd9990bc67e3804ef5cb7c090542875cae9

Comment by Githook User [ 06/Dec/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4784 Disable shared libmongoc targets if `ENABLE_SHARED=OFF` (#1486)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/54f737ea488caadac0cf9275c4be1fbb37cf5609

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