Modularized getting of CMake options #3487
Open
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.
This PR aims to be a followup of:
CMakeMake
easyblock also setPython_EXECUTABLE
option, as well asPython3_EXECUTABLE
andPython2_EXECUTABLE
derivatives (when appropriate) #3463by modularizing not only the getting of the CMake options for Python but all of them.
The idea is to allow other easyblocks inheriting from CMakeMake to get the same options as in the base easyblock without having to call the
configure
method first.An example usecase where this would be useful is the new LLVM easyblock:
LLVM
easyblock for compilation of clang/flang + other llvm-projects #3373where due to the complex logic across stages of compilation it is handy to have all the options in a
dict
instead of working withself.cfg
andconfigopts
.This still cannot be achieved by just storing the options in a class variable as in #3463 as other options needs to be set beside the base one before running CMake
The only minor distinction in the new function is the setting of
BUILD_SHARED_LIBS
which should not alter the behavior of CMakeMake as options already set inconfigopts
will take precedence over those inoptions
(easybuild-easyblocks/easybuild/easyblocks/generic/cmakemake.py
Lines 205 to 206 in 3a6cb1a
Manually tested with: