Skip to content

Commit

Permalink
Add filter for supported targets
Browse files Browse the repository at this point in the history
  • Loading branch information
oteffahi committed Apr 5, 2024
1 parent 60c86de commit 7a59519
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions recipes/zenoh-c/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv, Environment
from conan.tools.files import get, copy, replace_in_file, save, rmdir, rm, rename
Expand Down Expand Up @@ -32,6 +33,18 @@ class ZenohCConan(ConanFile):
"ZENOHC_CARGO_FLAGS": "",
}

@property
def _supported_platforms(self):
return [
("Windows", "x86_64"),
("Linux", "x86_64"),
("Linux", "armv6"),
("Linux", "armv7hf"),
("Linux", "armv8"),
("Macos", "x86_64"),
("Macos", "armv8"),
]

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -45,6 +58,10 @@ def configure(self):
def layout(self):
cmake_layout(self, src_folder="src")

def validate(self):
if (self.settings.os, self.settings.arch) not in self._supported_platforms:
raise ConanInvalidConfiguration("{}/{} combination is not supported".format(self.settings.os, self.settings.arch))

def requirements(self):
pass

Expand Down

0 comments on commit 7a59519

Please sign in to comment.