Skip to content

Commit

Permalink
Add minimum compiler check for cpp 17 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
datalogics-staylor committed Apr 23, 2024
1 parent 1452c20 commit 1d5fdb3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions recipes/icu/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ def _enable_icu_tools(self):
def _with_unit_tests(self):
return not self.conf.get("tools.build:skip_test", default=True, check_type=bool)

@property
def _minimum_compilers_version(self):
return {
"Visual Studio": "16",
"msvc": "192",
"gcc": "8",
"clang": "9",
"apple-clang": "12" if Version(self.version) >= "6.5.0" else "11"
}

def export_sources(self):
export_conandata_patches(self)

Expand All @@ -77,6 +87,11 @@ def validate(self):

if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 17)

Check failure on line 89 in recipes/icu/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Undefined variable 'check_min_cppstd'
minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False)
if not minimum_version:
self.output.warning("C++17 support required. Your compiler is unknown. Assuming it supports C++17.")
elif Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.")

def layout(self):
basic_layout(self, src_folder="src")
Expand Down

0 comments on commit 1d5fdb3

Please sign in to comment.