about summary refs log tree commit diff
path: root/absl
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-12-20T20·36-0800
committerXiaoyi Zhang <zhangxy988@gmail.com>2018-12-21T19·43-0500
commit7bd8f36c741c7cbe311611d7981bf38ba04c6fef (patch)
tree5e0fa6cf7f7bec720c9e5fca5b1572b0a82e5c9a /absl
parent968a34ffdaadd7db062a9621dfbdf8b2d16e05af (diff)
Export of internal Abseil changes.
--
d99e8545a19cec7569c1f04404398e4d31e71e81 by Mark Barolak <mbar@google.com>:

Internal import of GitHub PR #231: "Add Conan recipe"
https://github.com/abseil/abseil-cpp/pull/231

PiperOrigin-RevId: 226376774
GitOrigin-RevId: d99e8545a19cec7569c1f04404398e4d31e71e81
Change-Id: I763db5e14b9d0250c0859b3c12a4b8f374362c15
Diffstat (limited to 'absl')
-rw-r--r--absl/conanfile.py83
1 files changed, 83 insertions, 0 deletions
diff --git a/absl/conanfile.py b/absl/conanfile.py
new file mode 100644
index 000000000000..d8307b4568ef
--- /dev/null
+++ b/absl/conanfile.py
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Note: Conan is supported on a best-effort basis. Abseil doesn't use Conan
+# internally, so we won't know if it stops working. We may ask community
+# members to help us debug any problems that arise.
+
+from conans import ConanFile, CMake, tools
+from conans.errors import ConanInvalidConfiguration
+from conans.model.version import Version
+
+
+class AbseilConan(ConanFile):
+    name = "abseil"
+    url = "https://github.com/abseil/abseil-cpp"
+    homepage = url
+    author = "Abseil <abseil-io@googlegroups.com>"
+    description = "Abseil Common Libraries (C++) from Google"
+    license = "Apache-2.0"
+    topics = ("conan", "abseil", "abseil-cpp", "google", "common-libraries")
+    exports = ["LICENSE"]
+    exports_sources = ["CMakeLists.txt", "CMake/*", "absl/*"]
+    generators = "cmake"
+    settings = "os", "arch", "compiler", "build_type"
+
+    def configure(self):
+        if self.settings.os == "Windows" and \
+           self.settings.compiler == "Visual Studio" and \
+           Version(self.settings.compiler.version.value) < "14":
+            raise ConanInvalidConfiguration("Abseil does not support MSVC < 14")
+
+    def build(self):
+        tools.replace_in_file("CMakeLists.txt", "project(absl)", "project(absl)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()")
+        cmake = CMake(self)
+        cmake.definitions["BUILD_TESTING"] = False
+        cmake.configure()
+        cmake.build()
+
+    def package(self):
+        self.copy("LICENSE", dst="licenses")
+        self.copy("*.h", dst="include", src="absl")
+        self.copy("*.inc", dst="include", src="absl")
+        self.copy("*.a", dst="lib", src=".", keep_path=False)
+        self.copy("*.lib", dst="lib", src=".", keep_path=False)
+
+    def package_info(self):
+        self.cpp_info.libs = ["absl_base",
+                              "absl_synchronization",
+                              "absl_strings",
+                              "absl_symbolize",
+                              "absl_malloc_internal",
+                              "absl_time",
+                              "absl_strings",
+                              "absl_base",
+                              "absl_dynamic_annotations",
+                              "absl_spinlock_wait",
+                              "absl_throw_delegate",
+                              "absl_stacktrace",
+                              "absl_int128",
+                              "absl_span",
+                              "test_instance_tracker_lib",
+                              "absl_stack_consumption",
+                              "absl_bad_any_cast",
+                              "absl_hash",
+                              "str_format_extension_internal",
+                              "absl_failure_signal_handler",
+                              "absl_str_format",
+                              "absl_numeric",
+                              "absl_any",
+                              "absl_optional",
+                              "absl_container",
+                              "absl_debugging",
+                              "absl_memory",
+                              "absl_leak_check",
+                              "absl_meta",
+                              "absl_utility",
+                              "str_format_internal",
+                              "absl_variant",
+                              "absl_examine_stack",
+                              "absl_bad_optional_access",
+                              "absl_algorithm"]
+        if self.settings.os == "Linux":
+            self.cpp_info.libs.append("pthread")