From 4f4a376da214b9ff574c073060045e9ae8994edd Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Sat, 2 Oct 2021 23:01:42 +0200 Subject: [PATCH] (#7472) aws-c-common/0.6.9: Use STATIC_CRT cmake definitions * Use STATIC_CRT cmake definitions * Invalidate shared+ mt runtime --- recipes/aws-c-common/all/conanfile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/aws-c-common/all/conanfile.py b/recipes/aws-c-common/all/conanfile.py index 6ca080c7a5bf5..0ff48080a4a53 100644 --- a/recipes/aws-c-common/all/conanfile.py +++ b/recipes/aws-c-common/all/conanfile.py @@ -1,5 +1,6 @@ import os from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration required_conan_version = ">=1.33.0" @@ -38,6 +39,10 @@ def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.libcxx + def validate(self): + if self.settings.compiler == "Visual Studio" and self.options.shared and "MT" in self.settings.compiler.runtime: + raise ConanInvalidConfiguration("Static runtime + shared is not working for more recent releases") + def source(self): tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) @@ -47,6 +52,8 @@ def _configure_cmake(self): return self._cmake self._cmake = CMake(self) self._cmake.definitions["BUILD_TESTING"] = False + if self.settings.compiler == "Visual Studio": + self._cmake.definitions["STATIC_CRT"] = "MT" in self.settings.compiler.runtime self._cmake.configure() return self._cmake