Add conan build options
This commit is contained in:
12
conanfile.py
12
conanfile.py
@@ -12,9 +12,13 @@ class PlatformConan(ConanFile):
|
|||||||
settings = "os", "compiler", "build_type", "arch"
|
settings = "os", "compiler", "build_type", "arch"
|
||||||
options = {
|
options = {
|
||||||
"enable_testing": [True, False],
|
"enable_testing": [True, False],
|
||||||
|
"shared": [True, False],
|
||||||
|
"fPIC": [True, False],
|
||||||
}
|
}
|
||||||
default_options = {
|
default_options = {
|
||||||
"enable_testing": False,
|
"enable_testing": False,
|
||||||
|
"shared": False,
|
||||||
|
"fPIC": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sources are located in the same place as this recipe, copy them to the recipe
|
# Sources are located in the same place as this recipe, copy them to the recipe
|
||||||
@@ -47,6 +51,14 @@ class PlatformConan(ConanFile):
|
|||||||
self.test_requires("catch2/3.8.1")
|
self.test_requires("catch2/3.8.1")
|
||||||
self.test_requires("arff-files/1.2.1")
|
self.test_requires("arff-files/1.2.1")
|
||||||
|
|
||||||
|
def config_options(self):
|
||||||
|
if self.settings.os == "Windows":
|
||||||
|
del self.options.fPIC
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
if self.options.shared:
|
||||||
|
self.options.rm_safe("fPIC")
|
||||||
|
|
||||||
def layout(self):
|
def layout(self):
|
||||||
cmake_layout(self)
|
cmake_layout(self)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user