Skip to content

Commit

Permalink
conan: add compiler version guard
Browse files Browse the repository at this point in the history
KeenKraken fail with GCC11 because
    GCC is missing the -no-dangling-pointer flag
KnottyKraken fail compiling with GCC 12
    because of the STUPID boost::intrusive_ptr extension
  • Loading branch information
branylagaffe committed May 7, 2024
1 parent 1c6b216 commit 8da7842
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ class KeenKraken(ConanFile):
def set_name(self):
self.name = self.name or None

def configure(self):
if self.name == None:
raise ConanInvalidConfiguration("Need to set a name to compile [keenkraken/knottykraken]")
if self.name == 'keenkraken' and int(self.settings_build.get_safe('compiler.version')) < 12:
raise ConanInvalidConfiguration("Need GCC 12.3 at least to build keenkraken")
if self.name == 'knottykraken' and int(self.settings_build.get_safe('compiler.version')) < 13:
raise ConanInvalidConfiguration("Need GCC 13.1 at least to build knottykraken")


def layout(self):
cmake_layout(self, build_folder='.', src_folder=self.recipe_folder)

Expand All @@ -39,10 +48,6 @@ def build_requirements(self):
self.tool_requires("ninja/1.12.0")

def generate(self):

if self.name == None:
raise ConanInvalidConfiguration("Need to set a name to compile [keenkraken/knottykraken]")

tc = CMakeToolchain(self, generator="Ninja")
tc.cache_variables['SIMULATOR'] = self.name
tc.preprocessor_definitions["SELECTED_DEBUG"] = "vverb"
Expand Down

0 comments on commit 8da7842

Please sign in to comment.