Skip to content

Commit

Permalink
build: _std_format_minimum_compilers_version added
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Jan 23, 2024
1 parent 1a04019 commit 8e52792
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ def _minimum_compilers_version(self):
# , "msvc": "192"
}

@property
def _std_format_minimum_compilers_version(self):
return {
"gcc": "13",
"clang": "17"
# , "apple-clang": "15"
# , "msvc": "192"
}

@property
def _build_all(self):
return bool(self.conf.get("user.build:all", default=False))
Expand Down Expand Up @@ -128,6 +137,12 @@ def loose_lt_semver(v1, v2):
raise ConanInvalidConfiguration(
f"{self.ref} requires at least {compiler} {min_version} ({compiler.version} in use)"
)
if not self.options.use_fmtlib:
min_version = self._std_format_minimum_compilers_version.get(str(compiler))
if min_version and loose_lt_semver(str(compiler.version), min_version):
raise ConanInvalidConfiguration(
f"`std::format` requires at least {compiler} {min_version} ({compiler.version} in use). Use `-o use_fmtlib=True` instead."
)

def layout(self):
cmake_layout(self)
Expand Down

0 comments on commit 8e52792

Please sign in to comment.