Skip to content

Commit

Permalink
[SCons] Require minimum HighFive version
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Jul 5, 2023
1 parent 2cf33cf commit f89efe8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion SConstruct
Expand Up @@ -1548,13 +1548,21 @@ if env["use_hdf5"] and env["system_highfive"] in ("y", "default"):

if conf.CheckLibWithHeader(
"hdf5", "highfive/H5File.hpp", language="C++", autoadd=False):
env["system_highfive"] = True

highfive_include = "<highfive/H5Version.hpp>"
h5_version_source = get_expression_value(
[highfive_include], "QUOTE(HIGHFIVE_VERSION)")
retcode, h5_lib_version = conf.TryRun(h5_version_source, ".cpp")
if retcode:
if parse_version(h5_lib_version) < parse_version("2.5"):
if env["system_highfive"] == "y":
config_error(
f"System HighFive version {h5_lib_version} is not "
"supported; version 2.5 or higher is required.")
logger.info(
f"System HighFive version {h5_lib_version} is not supported.")
else:
env["system_highfive"] = True
env["HIGHFIVE_VERSION"] = h5_lib_version.strip()
else:
config_error("Detected invalid HighFive configuration.")
Expand Down

0 comments on commit f89efe8

Please sign in to comment.