CMakeLists.txt - Hide Unit Test related stuff behind option#171
CMakeLists.txt - Hide Unit Test related stuff behind option#171Jogi7819 wants to merge 1 commit intoWG21-SG14:masterfrom
Conversation
|
Will check that today and give a feedback. But still if that commit would be fine I would suggest to hide all test related stuff behind an option that can be set by a top-level project. |
You are right the package is not required anymore and can be removed. Done in my PR. |
Quuxplusone
left a comment
There was a problem hiding this comment.
Seems harmless to me, but also IMHO unnecessary. I don't know much about how we expect this library to be consumed. Does it really make sense for someone to want to consume this library without running its tests? And if they did, would they really do that by wholesale-importing the CMakeLists.txt that we wrote, instead of by just cutting and pasting the single .h file they were interested in?
CMakeLists.txt
Outdated
| elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
| target_compile_options(${TEST_NAME} PRIVATE -Wall -Wextra -Werror) | ||
| set_source_files_properties(${SG14_TEST_SOURCE_DIRECTORY}/plf_colony_test.cpp PROPERTIES | ||
| COMPILE_FLAGS "-Wno-unused-parameter") |
There was a problem hiding this comment.
Could you uncuddle this parenthesis again, so that git show -b will have one fewer gratuitous diff?
One aim of modern cmake is to provide everything by target and target specific. Means to me: includes, flags, definitions, etc. |
Hide required package THREAD behind option to give the consumer the choice to only add the project interface target without any test dependencies.