Skip to content

Commit

Permalink
catch2: fix using catch2 in C++17 code
Browse files Browse the repository at this point in the history
Catch2 has compile-time bugs if we use it in C++17 code with some of the
new C++17 types like string_view. For example the following line will cause
bugs:

REQUIRE(string_view("abc") == "abc");

The bug is documented in the upstream issue tracker here:
catchorg/Catch2#2462

We fix the bug downstream by building Catch2 itself in C++17 mode.

Additionally, enable building with GCC 5, the current version does not fail
anymore with GCC 5.
  • Loading branch information
dimztimz authored Jun 7, 2023
1 parent 0f58048 commit 2880f9a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Formula/catch2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Catch2 < Formula
url "https://github.com/catchorg/Catch2/archive/v3.3.2.tar.gz"
sha256 "8361907f4d9bff3ae7c1edb027f813659f793053c99b67837a0c0375f065bae2"
license "BSL-1.0"
revision 1

bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "15f5edc179c4627d31eb25a0628eaa7b9d6807afb874e363a1fc6e6ae7161146"
Expand All @@ -17,11 +18,9 @@ class Catch2 < Formula

depends_on "cmake" => :build

fails_with gcc: "5"

def install
mkdir "build" do
system "cmake", "..", "-DBUILD_TESTING=OFF", *std_cmake_args
system "cmake", "..", "-DBUILD_TESTING=OFF", "-DCMAKE_CXX_STANDARD=17", *std_cmake_args
system "cmake", "--build", ".", "--target", "install"
end
end
Expand Down

0 comments on commit 2880f9a

Please sign in to comment.