summarylogtreecommitdiffstats
path: root/unbundle-catch2.patch
blob: caba07577b316266699b33accddbf117f33d8f2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,11 +136,16 @@ if (DYNARMIC_TESTS_USE_UNICORN)
     find_package(Unicorn REQUIRED)
 endif()
 
+find_package(Catch2 QUIET)
+if (Catch2_FOUND)
+    add_library(catch ALIAS Catch2::Catch2)
+endif()
+
 # Pull in externals CMakeLists for libs where available
 add_subdirectory(externals)
 
 # Dynarmic project files
 add_subdirectory(src/dynarmic)
-if (DYNARMIC_TESTS)
+if (DYNARMIC_TESTS AND TARGET catch)
     add_subdirectory(tests)
 endif()
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -2,11 +2,6 @@
 # simply add the directory to that file as a subdirectory
 # to have CMake automatically recognize them.
 
-# catch
-
-add_library(catch INTERFACE)
-target_include_directories(catch INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/catch/include>)
-
 # fmt
 
 if (NOT DYNARMIC_NO_BUNDLED_FMT)