blob: 18b3aab24b58e5f549ac0487e7605a6b16677ff5 [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"
19 requires = "cctz/2.2@bincrafters/stable"
20
21 def configure(self):
22 if self.settings.os == "Windows" and \
23 self.settings.compiler == "Visual Studio" and \
24 Version(self.settings.compiler.version.value) < "14":
25 raise ConanInvalidConfiguration("Abseil does not support MSVC < 14")
26
27 def build(self):
28 tools.replace_in_file("CMakeLists.txt", "project(absl)", "project(absl)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()")
29 cmake = CMake(self)
30 cmake.definitions["BUILD_TESTING"] = False
31 cmake.configure()
32 cmake.build()
33
34 def package(self):
35 self.copy("LICENSE", dst="licenses")
36 self.copy("*.h", dst="include", src="absl")
37 self.copy("*.inc", dst="include", src="absl")
38 self.copy("*.a", dst="lib", src=".", keep_path=False)
39 self.copy("*.lib", dst="lib", src=".", keep_path=False)
40
41 def package_info(self):
42 self.cpp_info.libs = ["absl_base",
43 "absl_synchronization",
44 "absl_strings",
45 "absl_symbolize",
46 "absl_malloc_internal",
47 "absl_time",
48 "absl_strings",
49 "absl_base",
50 "absl_dynamic_annotations",
51 "absl_spinlock_wait",
52 "absl_throw_delegate",
53 "absl_stacktrace",
54 "absl_int128",
55 "absl_span",
56 "test_instance_tracker_lib",
57 "absl_stack_consumption",
58 "absl_bad_any_cast",
59 "absl_hash",
60 "str_format_extension_internal",
61 "absl_failure_signal_handler",
62 "absl_str_format",
63 "absl_numeric",
64 "absl_any",
65 "absl_optional",
66 "absl_container",
67 "absl_debugging",
68 "absl_memory",
69 "absl_leak_check",
70 "absl_meta",
71 "absl_utility",
72 "str_format_internal",
73 "absl_variant",
74 "absl_examine_stack",
75 "absl_bad_optional_access",
76 "absl_algorithm"]
77 if self.settings.os == "Linux":
78 self.cpp_info.libs.append("pthread")