Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

firewave
Copy link
Collaborator

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.

@@ -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}
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

@pfultz2 pfultz2 Apr 21, 2022

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
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

@firewave firewave changed the title added more make targets to CMake added remaining make targets to CMake Apr 15, 2022
@firewave
Copy link
Collaborator Author

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.

@firewave
Copy link
Collaborator Author

firewave commented Dec 2, 2023

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).

@firewave firewave closed this Dec 2, 2023
@firewave firewave deleted the cmake-3 branch December 2, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants