Closed wdconinc closed 9 months ago
@nathanwbrei Any preference on link_libraries or target_link_libraries? Anyone who's working on a CMake overhaul along with adding JANA2_USE_PODIO to the target property COMPILE_DEFINITIONS already, by chance?
@wdconinc:
I would say always use target_link_libraries.
Changed.
Can we just merge this? It causes compilation failures in our environments, and it takes time to debug issues, in particular when the bug has been reported, a pull request has been provided, but somehow it's waiting for something.
I did some follow-on work for this issue in a different branch, now here: #264
Without linking, the shared library only 'happens to work' in older gcc versions because no NEEDED entries are included in the shared library:
This causes linking errors in EICrecon (undefined references to ROOTFrameWriter functions).
After including podio in the linking, the necessary entries are there:
Note: It may make sense to revamp the CMakeLists.txt here to avoid this blanket link_libraries approach, and switch to a more granular target_link_libraries approach. See the note at https://cmake.org/cmake/help/latest/command/link_libraries.html.