Skip to content

Commit

Permalink
gici: require GCC v6
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Mar 19, 2024
1 parent 2e83781 commit 3304b84
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions recipes/gici/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import os

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd, valid_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm
from conan.tools.scm import Version

required_conan_version = ">=1.53.0"

Expand Down Expand Up @@ -33,6 +35,13 @@ class GiciConan(ConanFile):
def _min_cppstd(self):
return 11

@property
def _compilers_minimum_version(self):
return {
# For atomic_uint64_t
"gcc": "6",
}

def export_sources(self):
export_conandata_patches(self)
copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder)
Expand Down Expand Up @@ -69,6 +78,11 @@ def requirements(self):
def validate(self):
if self.settings.compiler.cppstd:
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."
)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down

0 comments on commit 3304b84

Please sign in to comment.