8 from conans
import ConanFile, CMake, tools
9 from conans.errors
import ConanInvalidConfiguration
10 from conans.model.version
import Version
15 url =
"https://github.com/abseil/abseil-cpp" 17 author =
"Abseil <abseil-io@googlegroups.com>" 18 description =
"Abseil Common Libraries (C++) from Google" 19 license =
"Apache-2.0" 20 topics = (
"conan",
"abseil",
"abseil-cpp",
"google",
"common-libraries")
22 exports_sources = [
"CMakeLists.txt",
"CMake/*",
"absl/*"]
24 settings =
"os",
"arch",
"compiler",
"build_type" 27 if self.settings.os ==
"Windows" and \
28 self.settings.compiler ==
"Visual Studio" and \
29 Version(self.settings.compiler.version.value) <
"14":
30 raise ConanInvalidConfiguration(
"Abseil does not support MSVC < 14")
33 tools.replace_in_file(
"CMakeLists.txt",
"project(absl)",
"project(absl)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()")
35 cmake.definitions[
"BUILD_TESTING"] =
False 40 self.copy(
"LICENSE", dst=
"licenses")
41 self.copy(
"*.h", dst=
"include", src=
".")
42 self.copy(
"*.inc", dst=
"include", src=
".")
43 self.copy(
"*.a", dst=
"lib", src=
".", keep_path=
False)
44 self.copy(
"*.lib", dst=
"lib", src=
".", keep_path=
False)
47 if self.settings.os ==
"Linux":
48 self.cpp_info.libs = [
"-Wl,--start-group"]
49 self.cpp_info.libs.extend(tools.collect_libs(self))
50 if self.settings.os ==
"Linux":
51 self.cpp_info.libs.extend([
"-Wl,--end-group",
"pthread"])