What happened?
Turning on BUILD_TESTING also installs a static library. src/CMakeLists.txt
has, at ef154d5 lines 520-537:
if(BUILD_TESTING)
# Create a library strictly for testing
add_library(conky_core ${conky_sources} ${optional_sources})
...
install(TARGETS conky_core
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
The comment says the library exists strictly for testing, but it is installed
unconditionally within that branch. So a distribution that wants to run the test
suite at package time gets usr/lib/libconky_core.a in the shipped package as a
side effect.
Measured on conky 1.22.3 with Arch's package build, same sources and flags
otherwise, only BUILD_TESTING differing:
tests off: 43 files packaged
tests on: 44 files packaged, the extra one usr/lib/libconky_core.a
!staticlibs, the makepkg option that normally strips static libraries, does not
remove it, because there is no matching shared library.
Why it matters
It makes "run the tests" and "change the installed artifacts" the same switch.
Distributions then have to carry a manual rm in their packaging, which is what
Arch's conky package will need to do. Anyone who enables the suite without
noticing ships the static library.
Suggested fix
Drop the install(TARGETS conky_core ...) block, or guard it behind its own
option that defaults off, so BUILD_TESTING only controls whether tests are
built and run.
Happy to send a PR if you agree on which of those you would prefer.
Version
ef154d5, and the same shape is present in 1.22.3.
What happened?
Turning on
BUILD_TESTINGalso installs a static library.src/CMakeLists.txthas, at ef154d5 lines 520-537:
The comment says the library exists strictly for testing, but it is installed
unconditionally within that branch. So a distribution that wants to run the test
suite at package time gets
usr/lib/libconky_core.ain the shipped package as aside effect.
Measured on conky 1.22.3 with Arch's package build, same sources and flags
otherwise, only
BUILD_TESTINGdiffering:!staticlibs, the makepkg option that normally strips static libraries, does notremove it, because there is no matching shared library.
Why it matters
It makes "run the tests" and "change the installed artifacts" the same switch.
Distributions then have to carry a manual
rmin their packaging, which is whatArch's conky package will need to do. Anyone who enables the suite without
noticing ships the static library.
Suggested fix
Drop the
install(TARGETS conky_core ...)block, or guard it behind its ownoption that defaults off, so
BUILD_TESTINGonly controls whether tests arebuilt and run.
Happy to send a PR if you agree on which of those you would prefer.
Version
ef154d5, and the same shape is present in 1.22.3.