[CMake] Add ACPP_HAS_* values to CMake integration. #1362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So far, to my knowledge, it is not easily possible to query on the CMake level whether the used AdaptiveCpp was built with certain features.
This adds a bunch of feature flags to the CMake integration making this quite simple.
E.g. CMake users can now just switch on
ACPP_HAS_SCPP
which target to set,omp;generic
if SSCP is available,omp;cuda:sm_80,sm_75;hip:gfx90c
or sth like this otherwise (the backend flags might help determine which targets to actually include ;-)).Further, this adds feature flags and the
REQUIRES:
clause to the LIT tests.With this,
ninja check
can always be executed independent of the actual supported feature set, as only those tests that are supported are run.This also prevents CPU overcommitting due to the parallelization done by the build system (ninja) and lit.