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

Make CMakeMake respect the toolchainopts when selecting build type #3452

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions easybuild/easyblocks/generic/cmakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def extra_options(extra_vars=None):
'build_shared_libs': [None, "Build shared library (instead of static library)"
"None can be used to add no flag (usually results in static library)", CUSTOM],
'build_type': [None, "Build type for CMake, e.g. Release."
"Defaults to 'Release' or 'Debug' depending on toolchainopts[debug]", CUSTOM],
"Defaults to 'Release', 'RelWithDebInfo' or 'Debug' depending on "
"toolchainopts[debug,noopt]", CUSTOM],
'configure_cmd': [DEFAULT_CONFIGURE_CMD, "Configure command to use", CUSTOM],
'generator': [None, "Build file generator to use. None to use CMakes default", CUSTOM],
'install_target_subdir': [None, "Subdirectory to use as installation target", CUSTOM],
Expand Down Expand Up @@ -148,7 +149,12 @@ def build_type(self):
"""Build type set in the EasyConfig with default determined by toolchainopts"""
build_type = self.cfg.get('build_type')
if build_type is None:
build_type = 'Debug' if self.toolchain.options.get('debug', None) else 'Release'
if self.toolchain.options.get('noopt', None): # also implies debug but is the closest match
build_type = 'Debug'
elif self.toolchain.options.get('debug', None):
build_type = 'RelWithDebInfo'
else:
build_type = 'Release'
return build_type

def prepend_config_opts(self, config_opts):
Expand Down
Loading