Skip to content

Commit

Permalink
(#7472) aws-c-common/0.6.9: Use STATIC_CRT cmake definitions
Browse files Browse the repository at this point in the history
* Use STATIC_CRT cmake definitions

* Invalidate shared+ mt runtime
  • Loading branch information
MartinDelille authored Oct 2, 2021
1 parent 771db98 commit 4f4a376
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes/aws-c-common/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration

required_conan_version = ">=1.33.0"

Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit 4f4a376

Please sign in to comment.