-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added remaining make targets to CMake #4026
Conversation
@@ -59,7 +66,7 @@ if (BUILD_TESTS) | |||
ProcessorCount(N) | |||
set(CTEST_PARALLEL_LEVEL ${N} CACHE STRING "CTest parallel level") | |||
set(CTEST_TIMEOUT 90 CACHE STRING "CTest timeout") | |||
add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout ${CTEST_TIMEOUT} | |||
add_custom_target(check-ctest ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout ${CTEST_TIMEOUT} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have check
run ctest as currently does. I dont see the purpose of renaming this target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to align it with the Makefile
for now. This target (among others) will be deprecated since it is totally unnecessary since you should just use the ctest
command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most developers(including me) use make check
to run the tests with ctest. I really dont want to see it change to something that is suboptimal.
Also, its shorter to do make -j $(nproc) check
than doing make -j $(nproc) cppcheck testrunner && ctest --output-on-failure -j $(nproc) .
, so this shouldn't be removed either.
#add_custom_target(test $<TARGET_FILE:testrunner> | ||
# DEPENDS cppcheck testrunner) | ||
|
||
add_custom_target(check $<TARGET_FILE:testrunner> -q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont understand the purpose of this, as ctest will already run the tests in the testrunner and it will run faster. Can we name this run-testrunner
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I want to align Makefile
with CMake so there's an easy transition when moving to CMake. The Makefile
should be completely deprecated or stripped down a bit.
There's lots of more things in CMake which can be simplified and consolidated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I want to align Makefile with CMake so there's an easy transition when moving to CMake.
I think only @danmar uses the Makefile(and he seems more focused on cppcheck premium recently too). As far as I know, most other developers and contributors use cmake.
We can definitely provide targets to do the same functionality as in the makefile, but I dont see the need to name them exactly the same, especially when the name already overlaps with targets developers are already using in cmake.
We probably need to document the targets which are actually interesting to the user. Currently you need to look up in the code what the targets actually do and if they are of interest. This also would allow us to rename/deprecate existing ones more easily. But the whole build configuration is quite messy - another reason I would like to get rid of some build systems. And I think it would make sense to get rid of certain things before putting them into writing (i.e. stone). Beside it also saving the time of documenting things which are on the way out. |
Closing as the functionality is all there now and there is no need to mirror all the targets exactly (that was a bit obsessive TBH). |
With these we now have target parity between make and CMake.
There's still some compiler/platform-specific code which needs to be added to CMake for full parity.