blob: d8307b4568ef20057afc97626f7608620e456ee6 [file] [log] [blame]
Uilian Ries32930d72018-12-03 17:52:53 -02001#!/usr/bin/env python
2# -*- coding: utf-8 -*-
ahedberge41b5b12018-12-20 13:51:25 -05003
4# Note: Conan is supported on a best-effort basis. Abseil doesn't use Conan
5# internally, so we won't know if it stops working. We may ask community
6# members to help us debug any problems that arise.
7
Uilian Ries32930d72018-12-03 17:52:53 -02008from conans import ConanFile, CMake, tools
9from conans.errors import ConanInvalidConfiguration
10from conans.model.version import Version
11
12
13class AbseilConan(ConanFile):
14 name = "abseil"
15 url = "https://github.com/abseil/abseil-cpp"
16 homepage = url
Uilian Ries325cf0d2018-12-20 09:41:53 -020017 author = "Abseil <abseil-io@googlegroups.com>"
Uilian Ries32930d72018-12-03 17:52:53 -020018 description = "Abseil Common Libraries (C++) from Google"
19 license = "Apache-2.0"
Uilian Ries1aa550f2018-12-13 08:33:39 -020020 topics = ("conan", "abseil", "abseil-cpp", "google", "common-libraries")
Uilian Ries32930d72018-12-03 17:52:53 -020021 exports = ["LICENSE"]
22 exports_sources = ["CMakeLists.txt", "CMake/*", "absl/*"]
23 generators = "cmake"
24 settings = "os", "arch", "compiler", "build_type"
Uilian Ries32930d72018-12-03 17:52:53 -020025
26 def configure(self):
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")
31
32 def build(self):
33 tools.replace_in_file("CMakeLists.txt", "project(absl)", "project(absl)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()")
34 cmake = CMake(self)
35 cmake.definitions["BUILD_TESTING"] = False
36 cmake.configure()
37 cmake.build()
38
39 def package(self):
40 self.copy("LICENSE", dst="licenses")
41 self.copy("*.h", dst="include", src="absl")
42 self.copy("*.inc", dst="include", src="absl")
43 self.copy("*.a", dst="lib", src=".", keep_path=False)
44 self.copy("*.lib", dst="lib", src=".", keep_path=False)
45
46 def package_info(self):
47 self.cpp_info.libs = ["absl_base",
48 "absl_synchronization",
49 "absl_strings",
50 "absl_symbolize",
51 "absl_malloc_internal",
52 "absl_time",
53 "absl_strings",
54 "absl_base",
55 "absl_dynamic_annotations",
56 "absl_spinlock_wait",
57 "absl_throw_delegate",
58 "absl_stacktrace",
59 "absl_int128",
60 "absl_span",
61 "test_instance_tracker_lib",
62 "absl_stack_consumption",
63 "absl_bad_any_cast",
64 "absl_hash",
65 "str_format_extension_internal",
66 "absl_failure_signal_handler",
67 "absl_str_format",
68 "absl_numeric",
69 "absl_any",
70 "absl_optional",
71 "absl_container",
72 "absl_debugging",
73 "absl_memory",
74 "absl_leak_check",
75 "absl_meta",
76 "absl_utility",
77 "str_format_internal",
78 "absl_variant",
79 "absl_examine_stack",
80 "absl_bad_optional_access",
81 "absl_algorithm"]
82 if self.settings.os == "Linux":
83 self.cpp_info.libs.append("pthread")