Skip to content

Commit

Permalink
Merge pull request #3452 from Micket/relwithdebinfo
Browse files Browse the repository at this point in the history
Make `CMakeMake` respect the toolchainopts when selecting build type
  • Loading branch information
bartoldeman authored Sep 27, 2024
2 parents a0b0958 + 3b69603 commit 710a3f6
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 710a3f6

Please sign in to comment.