Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-511

Use of TARGET_OBJECTS in CMake build produces incorrect shared library

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 0.1.0
    • Affects Version/s: None
    • Component/s: Build
    • None

      We currently compose our top level dynamic library out of several smaller pseudo libraries, set up with TARGET_OBJECTS.

      This doesn't work quite as intended however, because it means that target properties set on the shared object at the top level are not propagated to the compilation of the individual object files. For instance, setting CMAKE_CXX_VISIBILITY_PRESET to hidden does not cause -fvisibiliity-inlines-hidden to be applied to objects that are built into one of the TARGET_OBJECTS groups.

      It is possible that there is a way around this, but even if there is, I'm not sure it is what we want.

      The fact is that we want .o's that are compiled and headed, ultimately, for an archive to be built with different flags than those headed for a dynamic library.

            Assignee:
            tyler@10gen.com Tyler Brock
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: