Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-7905

Fix incorrect builtin behaviour for builds in CMake

    • 5
    • Storage - Ra 2021-08-23


      Currently the builtin options (HAVE_BUILTIN_EXTENSION_LZ4, HAVE_BUILTIN_EXTENSION_SNAPPY, ...) don't work as expected for CMake builds of libwiredtiger.

      When building the wiredtiger library with builtins, the builtin extensions only get compiled as individual libraries. We incorrectly use the target_link_libraries helper expecting CMake to link the contents of the builtin libraries into the standalone wiredtiger library binary. This is not how target_link_libraries  works when its between two library targets.

      Definition of Done:

      When a builtin is enabled, we want the symbols of the builtin library to be defined in the wiredtiger library. We can achieve this through compiling our builtins as CMake OBJECT libraries. We can then pass the contents of the object libraries as sources when defining the wiredtiger library.

      A draft patch to fix this issue has been attached to the ticket. This needs some further testing across different platforms to ensure we don't introduce any breaks.

      Should also ideally merged after WT-7830, as the changes in that ticket influence the way CMake handles position independent code (being important when using the object libraries in this tickets patch).

            jie.chen@mongodb.com Jie Chen
            alison.felizzi@mongodb.com Alison Felizzi (Inactive)
            0 Vote for this issue
            2 Start watching this issue