Skip to content

Commit

Permalink
catch2: add version 3.8.0 (#26312)
Browse files Browse the repository at this point in the history
* catch2: add version `3.8.0`

* catch2: maintenance changes

---------

Co-authored-by: Luis Caro Campos <[email protected]>
  • Loading branch information
gegles and jcar87 authored Jan 7, 2025
1 parent 0cd3295 commit eac98bd
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 350 deletions.
58 changes: 3 additions & 55 deletions recipes/catch2/3.x.x/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,16 @@
sources:
"3.8.0":
url: "https://github.com/catchorg/Catch2/archive/v3.8.0.tar.gz"
sha256: "1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087"
"3.7.1":
url: "https://github.com/catchorg/Catch2/archive/v3.7.1.tar.gz"
sha256: "c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c"
"3.7.0":
url: "https://github.com/catchorg/Catch2/archive/v3.7.0.tar.gz"
sha256: "5b10cd536fa3818112a82820ce0787bd9f2a906c618429e7c4dea639983c8e88"
"3.6.0":
url: "https://github.com/catchorg/Catch2/archive/v3.6.0.tar.gz"
sha256: "485932259a75c7c6b72d4b874242c489ea5155d17efa345eb8cc72159f49f356"
"3.5.4":
url: "https://github.com/catchorg/Catch2/archive/v3.5.4.tar.gz"
sha256: "b7754b711242c167d8f60b890695347f90a1ebc95949a045385114165d606dbb"
"3.5.3":
url: "https://github.com/catchorg/Catch2/archive/v3.5.3.tar.gz"
sha256: "8d723b0535c94860ef8cf6231580fa47d67a3416757ecb10639e40d748ab6c71"
"3.5.2":
url: "https://github.com/catchorg/Catch2/archive/v3.5.2.tar.gz"
sha256: "269543a49eb76f40b3f93ff231d4c24c27a7e16c90e47d2e45bcc564de470c6e"
"3.5.1":
url: "https://github.com/catchorg/Catch2/archive/v3.5.1.tar.gz"
sha256: "49c3ca7a68f1c8ec71307736bc6ed14fec21631707e1be9af45daf4037e75a08"
"3.5.0":
url: "https://github.com/catchorg/Catch2/archive/v3.5.0.tar.gz"
sha256: "f6d4f8d78a9b59ec72a81d49f58d18eb317372ac07f8d9432710a079e69fd66a"
"3.4.0":
url: "https://github.com/catchorg/Catch2/archive/v3.4.0.tar.gz"
sha256: "122928b814b75717316c71af69bd2b43387643ba076a6ec16e7882bfb2dfacbb"
"3.3.2":
url: "https://github.com/catchorg/Catch2/archive/v3.3.2.tar.gz"
sha256: "8361907f4d9bff3ae7c1edb027f813659f793053c99b67837a0c0375f065bae2"
"3.3.1":
url: "https://github.com/catchorg/Catch2/archive/v3.3.1.tar.gz"
sha256: "d90351cdc55421f640c553cfc0875a8c834428679444e8062e9187d05b18aace"
"3.3.0":
url: "https://github.com/catchorg/Catch2/archive/v3.3.0.tar.gz"
sha256: "fe2f29a54ca775c2dd04bb97ffb79d398e6210e3caa174348b5cd3b7e4ca887d"
"3.2.1":
url: "https://github.com/catchorg/Catch2/archive/v3.2.1.tar.gz"
sha256: "4613d3e8142b672159fcae252a4860d72c8cf8e2df5043b1ae3541db9ef5d73c"
"3.2.0":
url: "https://github.com/catchorg/Catch2/archive/v3.2.0.tar.gz"
sha256: "feee04647e28ac3cbeff46cb42abc8ee2d8d5f646d36e3fb3ba274b8c69a58ea"
"3.1.0":
url: "https://github.com/catchorg/Catch2/archive/v3.1.0.tar.gz"
sha256: "c252b2d9537e18046d8b82535069d2567f77043f8e644acf9a9fffc22ea6e6f7"
"3.0.1":
url: "https://github.com/catchorg/Catch2/archive/v3.0.1.tar.gz"
sha256: "8c4173c68ae7da1b5b505194a0c2d6f1b2aef4ec1e3e7463bde451f26bbaf4e7"
patches:
"3.1.0":
- patch_file: "patches/3.1.0-0001-fix-dll-install.patch"
patch_description: "Install dll in bin folder"
patch_type: "portability"
patch_source: "https://github.com/catchorg/Catch2/pull/2485"
- patch_file: "patches/3.1.0-0002-dllimport-global-symbols-msvc.patch"
patch_description: "Fix import of global symbols for msvc shared"
patch_type: "portability"
patch_source: "https://github.com/catchorg/Catch2/pull/2527"
"3.0.1":
- patch_file: "patches/3.0.1-0001-allow-shared.patch"
patch_description: "Allow to build catch2 as a shared library"
patch_type: "portability"
patch_source: "https://github.com/catchorg/Catch2/commit/bea58bf8bbfca887f871c3aa2d720ba62c01f855"
- patch_file: "patches/3.0.1-0002-dllimport-global-symbols-msvc.patch"
patch_description: "Fix import of global symbols for msvc shared"
patch_type: "portability"
patch_source: "https://github.com/catchorg/Catch2/pull/2527"
44 changes: 7 additions & 37 deletions recipes/catch2/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save
from conan.tools.files import copy, get, rmdir, save
from conan.tools.scm import Version
import os
import textwrap

required_conan_version = ">=1.54.0"
required_conan_version = ">=2.0"


class Catch2Conan(ConanFile):
Expand Down Expand Up @@ -39,32 +39,15 @@ class Catch2Conan(ConanFile):
# see https://github.com/conan-io/conan-center-index/issues/19008
extension_properties = {"compatibility_cppstd": False}

@property
def _min_cppstd(self):
return "14"

@property
def _min_console_width(self):
# Catch2 doesn't build if less than this value
return 46

@property
def _compilers_minimum_version(self):
return {
"gcc": "7",
"Visual Studio": "15",
"msvc": "191",
"clang": "5",
"apple-clang": "10",
}

@property
def _default_reporter_str(self):
return str(self.options.default_reporter).strip('"')

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -76,14 +59,12 @@ def configure(self):
def layout(self):
cmake_layout(self, src_folder="src")

def build_requirements(self):
if Version(self.version) >= "3.8.0":
self.tool_requires("cmake/[>=3.16 <4]")

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler doesn't support",
)
check_min_cppstd(self, 14)

try:
if int(self.options.console_width) < self._min_console_width:
Expand Down Expand Up @@ -111,7 +92,6 @@ def generate(self):
tc.generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down Expand Up @@ -178,13 +158,3 @@ def package_info(self):
if self.options.default_reporter:
defines.append(f"CATCH_CONFIG_DEFAULT_REPORTER={self._default_reporter_str}")
self.cpp_info.components["catch2_with_main"].defines = defines

# TODO: to remove in conan v2 once legacy generators removed
self.cpp_info.filenames["cmake_find_package"] = "Catch2"
self.cpp_info.filenames["cmake_find_package_multi"] = "Catch2"
self.cpp_info.names["cmake_find_package"] = "catch2"
self.cpp_info.names["cmake_find_package_multi"] = "catch2"
self.cpp_info.components["_catch2"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["_catch2"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
self.cpp_info.components["catch2_with_main"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["catch2_with_main"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
64 changes: 0 additions & 64 deletions recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch

This file was deleted.

This file was deleted.

Loading

0 comments on commit eac98bd

Please sign in to comment.