-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Makefile: streamline cmake-build & cleanup nuttx_, _default targets #11533
Conversation
cmake-build
& cleanup nuttx_
, _default
targets00a04e5
to
b5d82d6
Compare
Sounds good as long as we can maintain control of the options as needed.
I need to check the current state, but at one point this was intentional. There were issues with things like quashing console color output.
You mean the optional |
Thanks for your immediate response!
We should not go crazy on cmake options if it's avoidable but there are certain cases where configure time decision is necessary to achieve a certain customization.
If you know any such specific case I would like to test that to make sure there are no disadvantages. I was expecting
You mean |
I gave it a try with current cmake and everything seems fine so far. Let's go for it. |
cleanup nuttx_, _default targets
8ef37e4
to
89f2cbf
Compare
I restored the "you can omit _default" feature again in the last force push. I didn't find a way to wildcard the phony targets such that the abbreviated targets directly depend on the normal targets and there's no duplication. |
by comparing the configuration options that cmake reports from the cache with the ones from the current build
@dagar I found a way to check if rerunning cmake is necessary because the configuration options are now different than the ones in the cache of the build directory 67eb0ea I can achieve the behavior of minimal reconfiguration recompilation I described to you with this. default:
new:
This mechanism could maybe even be used to compile e.g. different px4_sitl_XXX target configurations in the same folder such that not everything has to be recompiled from scratch to an almost identical copy. |
Test data / coverage
Cygwin Windows SITL, draft unit test builds and some manual artificial test target builds to check for corner cases.
Describe problem solved by the proposed pull request
cmake-build
were limited to the-DCONFIG=$(PX4_CONFIG)
cmake parameter. There are currently multiple other makefile targets e.g.python_coverage
,scan-build
,px4_sitl_default-clang
, ... that also run cmake with their own invocation which could easily be streamlined to just calling thecmake-build
function that containes the latest tweaks for generator transitions, space escaping, caching. I came across this solution since I'm looking into how to best unify and improve unit testing setup (see the early draft here: master...MaEtUgR:gtest#diff-b67911656ef5d18c4ae36cb6741b7965R323).cmake --build ...
command to abstract the actually used build tool (see https://cmake.org/cmake/help/v2.8.11/cmake.html#opt%3a--builddir).NUTTX_CONFIG_TARGETS
target list was removed by @dagar in f692ad0#diff-b67911656ef5d18c4ae36cb6741b7965L162 because thenuttx_
prefix does not exist anymore. If this filtered multi target is still needed the list generation needs to be reimplemented anyways.ALL_CONFIG_TARGETS
for testing purposes