Hey there, I help package things in conda-forge, a pretty large ecosystem for Python, R, scientific computing, etc. We essentially do binary redistribution, but with tightly controlled metadata to ensure each environment uses libraries with a consistent ABI.
Obviously, many of our packages are built by CMake, so it’s a pretty essential part of the picture.
Some libraries change their ABI depending on the presence of certain symbols (e.g. NDEBUG
) – or which of their symbols are visible to the linker (e.g. PROTOBUF_USE_DLLS
). In most modern CMake-based projects, these symbols are embedded into the target interface via
target_compile_definitions(<target> [PUBLIC|INTERFACE] <SYMBOLNAME>)
This has worked well (to my understanding), but I’m recently finding several examples where this breaks – i.e. a project correctly builds with target_compile_definitions(...)
, but then the symbol is missing despite doing find_package(<target>)
from the consuming project.
As far as I understand the docs, this should not happen. Can someone tell me what’s going wrong?