Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: add compiler + remove compiler.version to reduce number of builds #1783

Merged
merged 10 commits into from
Jul 2, 2020
6 changes: 1 addition & 5 deletions recipes/cmake/3.x.x/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(cmake_wrapper)

if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
else()
include(conanbuildinfo.cmake)
endif()
include(conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory("source_subfolder")
4 changes: 3 additions & 1 deletion recipes/cmake/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class CMakeConan(ConanFile):
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"

requires = "openssl/1.1.1g"
Copy link
Contributor

@robert-shade robert-shade May 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openssl isn't enabled by default on Windows, I think this requires needs to be os specific

Copy link
Contributor Author

@madebr madebr May 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the link.
I'll have to add the CMAKE_USE_OPENSSL option.


_source_subfolder = "source_subfolder"
_cmake = None

Expand All @@ -34,7 +36,7 @@ def _configure_cmake(self):
self._cmake = CMake(self)
self._cmake.definitions["CMAKE_BOOTSTRAP"] = False
if self.settings.os == "Linux":
self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = True
self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = not self.options["openssl"].shared
self._cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-lz"
madebr marked this conversation as resolved.
Show resolved Hide resolved
self._cmake.configure()
return self._cmake
Expand Down