Skip to content

Commit

Permalink
(#16144) re2: modernize more for conan v2
Browse files Browse the repository at this point in the history
* modernize more

* fix topics
  • Loading branch information
SpaceIm committed Mar 16, 2023
1 parent fae9d5a commit 4ed81ee
Showing 1 changed file with 5 additions and 7 deletions.
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

0 comments on commit 4ed81ee

Please sign in to comment.