build: conanfile downcasting definitions fixed

This commit is contained in:
Mateusz Pusz
2020-09-09 20:55:36 +02:00
parent 8f49561242
commit 531c3bab7a

View File

@@ -49,10 +49,10 @@ class UnitsConan(ConanFile):
"ms-gsl/3.1.0" "ms-gsl/3.1.0"
) )
options = { options = {
"downcast": ["off", "on", "auto"] "downcast_mode": ["off", "on", "auto"]
} }
default_options = { default_options = {
"downcast": "on" "downcast_mode": "on"
} }
exports = ["LICENSE.md"] exports = ["LICENSE.md"]
exports_sources = ["docs/*", "src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"] exports_sources = ["docs/*", "src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
@@ -83,12 +83,12 @@ class UnitsConan(ConanFile):
def _configure_cmake(self, folder="src"): def _configure_cmake(self, folder="src"):
cmake = CMake(self) cmake = CMake(self)
if self.options.downcast_dispatch_mode == "off": if self.options.downcast_mode == "off":
cmake.definitions["UNITS_DOWNCAST"] = 0 cmake.definitions["DOWNCAST_MODE"] = 0
elif self.options.downcast_dispatch_mode == "on": elif self.options.downcast_mode == "on":
cmake.definitions["UNITS_DOWNCAST"] = 1 cmake.definitions["DOWNCAST_MODE"] = 1
elif self.options.downcast_dispatch_mode == "auto": elif self.options.downcast_mode == "auto":
cmake.definitions["UNITS_DOWNCAST"] = 2 cmake.definitions["DOWNCAST_MODE"] = 2
if self._run_tests: if self._run_tests:
# developer's mode (unit tests, examples, documentation, restrictive compilation warnings, ...) # developer's mode (unit tests, examples, documentation, restrictive compilation warnings, ...)