1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

[Conan] add validate method to catch incorrect combination of options

This commit is contained in:
Andrey Filipenkov 2023-03-01 12:18:35 +03:00
parent 5dd301efd2
commit c295c81bf2

View File

@ -204,7 +204,7 @@ class VCMI(ConanFile):
self.requires("qt/[~5.15.2]") self.requires("qt/[~5.15.2]")
# use Apple system libraries instead of external ones # use Apple system libraries instead of external ones
if self.options.with_apple_system_libs and not self.options.default_options_of_requirements and is_apple_os(self): if self.options.with_apple_system_libs and is_apple_os(self):
systemLibsOverrides = [ systemLibsOverrides = [
"bzip2/1.0.8", "bzip2/1.0.8",
"libiconv/1.17", "libiconv/1.17",
@ -223,6 +223,12 @@ class VCMI(ConanFile):
if self.options.with_luajit and not str(self.settings.arch).startswith("arm"): if self.options.with_luajit and not str(self.settings.arch).startswith("arm"):
self.requires("luajit/[~2.0.5]") self.requires("luajit/[~2.0.5]")
def validate(self):
if self.options.with_apple_system_libs and not is_apple_os(self):
raise ConanInvalidConfiguration("with_apple_system_libs is only for Apple platforms")
if self.options.with_apple_system_libs and self.options.default_options_of_requirements:
raise ConanInvalidConfiguration("with_apple_system_libs and default_options_of_requirements can't be True at the same time")
def generate(self): def generate(self):
tc = CMakeToolchain(self) tc = CMakeToolchain(self)
tc.variables["USING_CONAN"] = True tc.variables["USING_CONAN"] = True