Skip to content

Commit

Permalink
[Extern/Catch2] Updated Catch to 3.5.2
Browse files Browse the repository at this point in the history
- Catch2 is now a static library instead of a single header

- Renamed Catch.hpp/.cpp to CatchCustomMatchers.hpp/.cpp
  - Replaced inclusions of Catch.hpp by the needed specific Catch headers when applicable
  • Loading branch information
Razakhel committed Feb 23, 2024
1 parent a963f48 commit 718e47c
Show file tree
Hide file tree
Showing 363 changed files with 28,098 additions and 18,138 deletions.
1 change: 1 addition & 0 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ if (RAZ_USE_LUA)
include(Sol2)
endif ()

include(Catch2)
include(fastgltf)
include(stb)
49 changes: 49 additions & 0 deletions extern/Catch2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
##########
# Catch2 #
##########

project(Catch2)

add_library(Catch2 STATIC)

target_compile_features(Catch2 PRIVATE cxx_std_17)

# Configuring the user config manually, as it is done on Catch's side

# Declaring parameters needed for the configuration; see Catch's doc if more may need to be set
set(CATCH_CONFIG_DEFAULT_REPORTER "console" CACHE STRING "")
set(CATCH_CONFIG_CONSOLE_WIDTH "80" CACHE STRING "")

set(CATCH_USER_CONFIG_PATH "${CMAKE_BINARY_DIR}/generated-includes/catch2/catch_user_config.hpp")

configure_file(
"catch/catch2/catch_user_config.hpp.in"
"${CATCH_USER_CONFIG_PATH}"
)

file(
GLOB_RECURSE
CATCH2_FILES

catch/catch2/*.cpp
catch/catch2/*.hpp
"${CATCH_USER_CONFIG_PATH}"
)

target_sources(Catch2 PRIVATE ${CATCH2_FILES})

target_include_directories(
Catch2

SYSTEM
PUBLIC
catch
"${CMAKE_BINARY_DIR}/generated-includes"
)

# Disabling all compilers warnings
if (RAZ_COMPILER_MSVC)
target_compile_options(Catch2 PRIVATE /w)
else ()
target_compile_options(Catch2 PRIVATE -w)
endif ()
23 changes: 23 additions & 0 deletions extern/catch/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 718e47c

Please sign in to comment.