Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re2: modernize more for conan v2 #16144

Merged
merged 2 commits into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions recipes/re2/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
from conan.tools.files import copy, get, rmdir
import os

required_conan_version = ">=1.53.0"
required_conan_version = ">=1.54.0"


class Re2Conan(ConanFile):
name = "re2"
description = "Fast, safe, thread-friendly regular expression library"
topics = ("regex")
topics = ("regex",)
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/google/re2"
license = "BSD-3-Clause"

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand All @@ -37,18 +38,15 @@ def layout(self):
cmake_layout(self, src_folder="src")

def validate(self):
if self.info.settings.compiler.get_safe("cppstd"):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.variables["RE2_BUILD_TESTING"] = False
# Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()

def build(self):
Expand Down