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

Document library consumption from Scons & meson

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Gone away
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.21.0
    • None
    • None

    Description

      Updated description:

      Based on the discussion in this ticket, it is apparent that we need to document the proper way to consume libbson and libmongoc from some build systems. We currently provide pkg-config and CMake scripts which can be used directly by autotools and CMake, respectively. However, for other build systems it is necessary to document that consumption of libbson and libmongoc requires leveraging the build system's pkg-config compatibility features. See the discussion in this ticket for details and pointers.

      Original description follows:

      First of all, thank you. I appreciate your great work!

      I am using the prebuilt libmongoc from Ubuntu Jammy, installable with APT. I notice that libmogoc and libbson headers are installed to `/usr/include/libmongoc-1.0/mongoc/` and `/usr/include/libbson-1.0/bson/`, instead of the conventional `/usr/include/`. So when I do

      #include <libmongoc-1.0/mongoc/mongoc.h> 

      I get errors such as

      /usr/include/libmongoc-1.0/mongoc/mongoc.h:22:10: fatal error: bson/bson.h: No such file or directory
         22 | #include <bson/bson.h>
            |          ^~~~~~~~~~~~~
      

       

      The documentation only mentions cmake and pkg-config. For other build systems, such scons and meson, I have to hard-code the include path, by passing

      -isystem /usr/include/libbson-1.0 -isystem /usr/include/libmongoc-1.0 

      This is not only inconvenient, but also prevents overriding the system library with a custom one, typically installed into `/usr/local/include`.

      So, are there any reasons why these headers are not installed to `/usr/include/libmongoc-1.0/mongoc/` instead of the more conventional `/usr/include/mongoc/`? Thanks in advance.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lh_mouse@126.com LIU Hao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: