Skip to content

Commit

Permalink
ktx: require C++17 for <filesystem>
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed May 19, 2024
1 parent 92216f7 commit 035b205
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion recipes/ktx/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@ class KtxConan(ConanFile):
"tools": True,
}

@property
def _min_cppstd(self):
if Version(self.version) < "4.3.2":
return 11
return 17

@property
def _compilers_minimum_version(self):
if self._min_cppstd == 17:
return {
"gcc": "7",
"clang": "5",
"apple-clang": "9",
"msvc": "191",
"Visual Studio": "15",
}
return {}


@property
def _has_sse_support(self):
return self.settings.arch in ["x86", "x86_64"]
Expand Down Expand Up @@ -63,7 +82,12 @@ def requirements(self):

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
check_min_cppstd(self, self._min_cppstd)
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)
if Version(self.version) >= "4.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 6:
# astcenc_vecmathlib_sse_4.h:809:41: error: the last argument must be a 4-bit immediate
raise ConanInvalidConfiguration("GCC v6+ is required")
Expand Down

0 comments on commit 035b205

Please sign in to comment.