Skip to content

Commit

Permalink
cmake: Use cache for faster builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Croydon committed May 27, 2020
1 parent c5a5a1e commit 0ad4fd3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions recipes/cmake/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CMakeConan(ConanFile):
settings = "os_build", "arch_build", "compiler", "arch"

_source_subfolder = "source_subfolder"
_cmake = None

@property
def _arch(self):
Expand All @@ -38,13 +39,14 @@ def source(self):
os.rename(extracted_dir, self._source_subfolder)

def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["CMAKE_BOOTSTRAP"] = False
if self.settings.os_build == "Linux":
cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = True
cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-lz"
cmake.configure(source_dir=self._source_subfolder)
return cmake
if not self._cmake:
self._cmake = CMake(self)
self._cmake.definitions["CMAKE_BOOTSTRAP"] = False
if self.settings.os_build == "Linux":
self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = True
self._cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-lz"
self._cmake.configure(source_dir=self._source_subfolder)
return self._cmake

def build(self):
if self.settings.os_build == "Linux":
Expand Down

0 comments on commit 0ad4fd3

Please sign in to comment.