build-system: tests do not require the static library#95
build-system: tests do not require the static library#95eao197 merged 1 commit intoStiffstream:masterfrom bengsparks:cmakelists-tweak
Conversation
|
Hi! I've read the discussion in NixOS/nixpkgs and don't understand why this is a problem :( |
|
What would such a test hope to accomplish? Unittests concern themselves with functionality in isolation, building the library shared or static should not impact this. |
We had several cases in the past when an executable was linked fine with dynamic library, but there were error when linking with static library. Those cases where produced by errors in our code (missing of Anyway, I just want to understand what is the reason. Just avoid to build static version of a library because NixOS always uses dynamic libraries? |
|
Ah I see 😄 that makes sense. It is also custom to run tests to detect if a package is healthy. Please don't feel pressured into accepting this PR btw 😄 It is custom to submit such patches to upstream, but if you don't want to include it, we can simply include the patch in nixpkgs. Alternatively, if you wish to add tests to determine if static linkage will break, you could merge this PR, then add a separate test suite that is run only when at least the static library is built. Sort of like the examples, but enabled when tests are on. |
|
@bengsparks thanks for explanation. I think we can accept your PR. In a case when we'll need a test that links against the static library we'll do something. But because we have no such plains now it's better to have more simpler CMake files. |
Tests only link against the shared library, so the check in the CMakeLists for building the static library only prevents building tests.
sobjectizer/dev/cmake/unittest.cmake
Line 17 in 48240cf