Skip to content

Commit 96b020e

Browse files
committed
simplify search-path-cpp-headers option detection as its build option cannot be None
1 parent 45514ef commit 96b020e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

easybuild/tools/toolchain/toolchain.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,21 +1092,19 @@ def _add_dependency_cpp_headers(self, dep_root, extra_dirs=None):
10921092

10931093
# mode of operation is defined by search-path-cpp-headers option
10941094
# toolchain option has precedence over build option
1095-
cpp_headers_mode = DEFAULT_SEARCH_PATH_CPP_HEADERS
1095+
cpp_headers_mode = SEARCH_PATH_CPP_HEADERS
10961096
tc_opt = self.options.option("search-path-cpp-headers")
1097-
if tc_opt is not None:
1098-
self.log.debug("search-path-cpp-headers set by toolchain option: %s", cpp_headers_mode)
1097+
if tc_opt is not False:
10991098
cpp_headers_mode = tc_opt
1099+
self.log.debug("search-path-cpp-headers set by toolchain option: %s", cpp_headers_mode)
11001100
else:
1101-
build_opt = build_option("search_path_cpp_headers")
1102-
if build_opt is not None:
1103-
self.log.debug("search-path-cpp-headers set by build option: %s", cpp_headers_mode)
1104-
cpp_headers_mode = build_opt
1101+
cpp_headers_mode = build_option("search_path_cpp_headers")
1102+
self.log.debug("search-path-cpp-headers set by build option: %s", cpp_headers_mode)
11051103

11061104
if cpp_headers_mode not in SEARCH_PATH_CPP_HEADERS:
11071105
raise EasyBuildError(
1108-
"Unknown value selected for option search-path-cpp-headers. Choose one of: %s",
1109-
", ".join(SEARCH_PATH_CPP_HEADERS)
1106+
"Unknown value selected for option search-path-cpp-headers: %s. Choose one of: %s",
1107+
cpp_headers_mode, ", ".join(SEARCH_PATH_CPP_HEADERS)
11101108
)
11111109

11121110
for env_var in SEARCH_PATH_CPP_HEADERS[cpp_headers_mode]:

0 commit comments

Comments
 (0)