Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3511

Provide a way to express dependencies on cmake targets only on mongo::mongoc_static

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: cmake
    • None

      The cause of CDRIVER-3493 was having an explicit dependency on the mongo::mongocrypt target, but not having a call to find_dependency (mongocrypt) in mongoc-config.cmake. Currently, there's no great way to express such a dependency for consumers.

      mongoc-config.cmake is used for both static and shared targets (mongo::mongoc_shared and mongo::mongoc_static). But a dependency like that only needs to be exposed in the static target (since the shared target has already linked against libmongocrypt.so, and that location information is part of the library itself).

      So, adding a call to find_dependency in mongoc-config.cmake adds the dependency for both targets, even though we only need it for the static target. The workaround of CDRIVER-3493 was to not depend on the cmake target, and rather depend on the library explicitly (pulling that information out of the mongo::mongocrypt target) as an INTERFACE_LINK_LIBRARY.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: