blob: 6ac48705dc878a050897c4d1e4e71af1b6264ed0 [file] [log] [blame]
Uilian Ries32930d72018-12-03 17:52:53 -02001#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3from conans import ConanFile, CMake, tools
4from conans.errors import ConanInvalidConfiguration
5from conans.model.version import Version
6
7
8class AbseilConan(ConanFile):
9 name = "abseil"
10 url = "https://github.com/abseil/abseil-cpp"
11 homepage = url
12 author = "Ashley Hedberg <ahedberg@google.com>"
13 description = "Abseil Common Libraries (C++) from Google"
14 license = "Apache-2.0"
15 exports = ["LICENSE"]
16 exports_sources = ["CMakeLists.txt", "CMake/*", "absl/*"]
17 generators = "cmake"
18 settings = "os", "arch", "compiler", "build_type"
Uilian Ries32930d72018-12-03 17:52:53 -020019
20 def configure(self):
21 if self.settings.os == "Windows" and \
22 self.settings.compiler == "Visual Studio" and \
23 Version(self.settings.compiler.version.value) < "14":
24 raise ConanInvalidConfiguration("Abseil does not support MSVC < 14")
25
26 def build(self):
27 tools.replace_in_file("CMakeLists.txt", "project(absl)", "project(absl)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()")
28 cmake = CMake(self)
29 cmake.definitions["BUILD_TESTING"] = False
30 cmake.configure()
31 cmake.build()
32
33 def package(self):
34 self.copy("LICENSE", dst="licenses")
35 self.copy("*.h", dst="include", src="absl")
36 self.copy("*.inc", dst="include", src="absl")
37 self.copy("*.a", dst="lib", src=".", keep_path=False)
38 self.copy("*.lib", dst="lib", src=".", keep_path=False)
39
40 def package_info(self):
41 self.cpp_info.libs = ["absl_base",
42 "absl_synchronization",
43 "absl_strings",
44 "absl_symbolize",
45 "absl_malloc_internal",
46 "absl_time",
47 "absl_strings",
48 "absl_base",
49 "absl_dynamic_annotations",
50 "absl_spinlock_wait",
51 "absl_throw_delegate",
52 "absl_stacktrace",
53 "absl_int128",
54 "absl_span",
55 "test_instance_tracker_lib",
56 "absl_stack_consumption",
57 "absl_bad_any_cast",
58 "absl_hash",
59 "str_format_extension_internal",
60 "absl_failure_signal_handler",
61 "absl_str_format",
62 "absl_numeric",
63 "absl_any",
64 "absl_optional",
65 "absl_container",
66 "absl_debugging",
67 "absl_memory",
68 "absl_leak_check",
69 "absl_meta",
70 "absl_utility",
71 "str_format_internal",
72 "absl_variant",
73 "absl_examine_stack",
74 "absl_bad_optional_access",
75 "absl_algorithm"]
76 if self.settings.os == "Linux":
77 self.cpp_info.libs.append("pthread")