Drop --defsym in al-core.pc when not accepted - #84
SimonPinches wants to merge 1 commit into
Conversation
The Libs line of al-core.pc unconditionally contains '-Wl,--defsym,AL_VER_<version>=0', which stamps the Access Layer version into consuming binaries as a linker-defined symbol. --defsym is specific to GNU-compatible linkers: Apple's ld64 fails with 'ld: unknown option: --defsym' and MSVC's link.exe rejects it too, so any consumer linking against al-core via pkg-config on macOS fails. (First observed building the conda-forge imas-cpp/-fortran/-java packages for osx-64.) Make the flag a configure-time substitution that is emitted only on platforms with a GNU-compatible linker. The generated al-core.pc is unchanged on Linux.
965ce53 to
3190338
Compare
|
If we want keep stamping the IMAS-Core and HLI versions into the library binaries, a better mechanism would be to move it from the link line into a public header that every consumer compiles, e.g. in with an MSVC branch using With this approach we could track IMAS-Core, IMAS-HLI versions simultaneously at little cost. Not sure if we need to, but if we did.... |
The Libs line of
al-core.pcunconditionally contains'-Wl,--defsym,AL_VER_<version>=0', which stamps the Access Layer version into consuming binaries as a linker-defined symbol.--defsymis specific to GNU-compatible linkers: Apple'sld64fails with'ld: unknown option: --defsym'and MSVC'slink.exerejects it too, so any consumer linking againstal-coreviapkg-configon macOS fails. (First observed building the conda-forge imas-cpp/-fortran/-java packages for osx-64.)Make the flag a configure-time substitution that is emitted only on platforms with a GNU-compatible linker. The generated
al-core.pcis unchanged on Linux.