diff options
| author | 2022-01-12 00:36:20 +0100 | |
|---|---|---|
| committer | 2022-01-12 00:36:20 +0100 | |
| commit | c8b358dba254ea0478d1c1aa697a1276a6451347 (patch) | |
| tree | a5cac6c7bbbf6d4ebba3d942aefb3d5c7762c4c9 | |
| parent | Merge pull request #7633 from german77/hotkeys (diff) | |
| download | yuzu-c8b358dba254ea0478d1c1aa697a1276a6451347.tar.gz yuzu-c8b358dba254ea0478d1c1aa697a1276a6451347.tar.xz yuzu-c8b358dba254ea0478d1c1aa697a1276a6451347.zip | |
cmake: make tests optional
| -rw-r--r-- | CMakeLists.txt | 8 | ||||
| -rw-r--r-- | externals/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/tests/CMakeLists.txt | 2 |
4 files changed, 12 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 47bd282fb..4bf55d664 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -35,6 +35,8 @@ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF) | |||
| 35 | 35 | ||
| 36 | option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON) | 36 | option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON) |
| 37 | 37 | ||
| 38 | option(YUZU_TESTS "Compile tests" ON) | ||
| 39 | |||
| 38 | # Default to a Release build | 40 | # Default to a Release build |
| 39 | get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) | 41 | get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) |
| 40 | if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) | 42 | if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) |
| @@ -168,7 +170,6 @@ macro(yuzu_find_packages) | |||
| 168 | # Capitalization matters here. We need the naming to match the generated paths from Conan | 170 | # Capitalization matters here. We need the naming to match the generated paths from Conan |
| 169 | set(REQUIRED_LIBS | 171 | set(REQUIRED_LIBS |
| 170 | # Cmake Pkg Prefix Version Conan Pkg | 172 | # Cmake Pkg Prefix Version Conan Pkg |
| 171 | "Catch2 2.13.7 catch2/2.13.7" | ||
| 172 | "fmt 8.0.1 fmt/8.1.1" | 173 | "fmt 8.0.1 fmt/8.1.1" |
| 173 | "lz4 1.8 lz4/1.9.2" | 174 | "lz4 1.8 lz4/1.9.2" |
| 174 | "nlohmann_json 3.8 nlohmann_json/3.8.0" | 175 | "nlohmann_json 3.8 nlohmann_json/3.8.0" |
| @@ -177,6 +178,11 @@ macro(yuzu_find_packages) | |||
| 177 | # can't use opus until AVX check is fixed: https://github.com/yuzu-emu/yuzu/pull/4068 | 178 | # can't use opus until AVX check is fixed: https://github.com/yuzu-emu/yuzu/pull/4068 |
| 178 | #"opus 1.3 opus/1.3.1" | 179 | #"opus 1.3 opus/1.3.1" |
| 179 | ) | 180 | ) |
| 181 | if (YUZU_TESTS) | ||
| 182 | list(APPEND REQUIRED_LIBS | ||
| 183 | "Catch2 2.13.7 catch2/2.13.7" | ||
| 184 | ) | ||
| 185 | endif() | ||
| 180 | 186 | ||
| 181 | foreach(PACKAGE ${REQUIRED_LIBS}) | 187 | foreach(PACKAGE ${REQUIRED_LIBS}) |
| 182 | string(REGEX REPLACE "[ \t\r\n]+" ";" PACKAGE_SPLIT ${PACKAGE}) | 188 | string(REGEX REPLACE "[ \t\r\n]+" ";" PACKAGE_SPLIT ${PACKAGE}) |
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 158113516..82e8ef18c 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -13,10 +13,6 @@ if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) | |||
| 13 | target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES) | 13 | target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES) |
| 14 | endif() | 14 | endif() |
| 15 | 15 | ||
| 16 | # Catch | ||
| 17 | add_library(catch-single-include INTERFACE) | ||
| 18 | target_include_directories(catch-single-include INTERFACE catch/single_include) | ||
| 19 | |||
| 20 | # Dynarmic | 16 | # Dynarmic |
| 21 | if (ARCHITECTURE_x86_64) | 17 | if (ARCHITECTURE_x86_64) |
| 22 | set(DYNARMIC_TESTS OFF) | 18 | set(DYNARMIC_TESTS OFF) |
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 19d16147d..1bdf70b76 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
| @@ -151,7 +151,10 @@ add_subdirectory(audio_core) | |||
| 151 | add_subdirectory(video_core) | 151 | add_subdirectory(video_core) |
| 152 | add_subdirectory(input_common) | 152 | add_subdirectory(input_common) |
| 153 | add_subdirectory(shader_recompiler) | 153 | add_subdirectory(shader_recompiler) |
| 154 | add_subdirectory(tests) | 154 | |
| 155 | if (YUZU_TESTS) | ||
| 156 | add_subdirectory(tests) | ||
| 157 | endif() | ||
| 155 | 158 | ||
| 156 | if (ENABLE_SDL2) | 159 | if (ENABLE_SDL2) |
| 157 | add_subdirectory(yuzu_cmd) | 160 | add_subdirectory(yuzu_cmd) |
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 4a20c0768..a69ccb264 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt | |||
| @@ -16,6 +16,6 @@ add_executable(tests | |||
| 16 | create_target_directory_groups(tests) | 16 | create_target_directory_groups(tests) |
| 17 | 17 | ||
| 18 | target_link_libraries(tests PRIVATE common core input_common) | 18 | target_link_libraries(tests PRIVATE common core input_common) |
| 19 | target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch-single-include Threads::Threads) | 19 | target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Catch2::Catch2 Threads::Threads) |
| 20 | 20 | ||
| 21 | add_test(NAME tests COMMAND tests) | 21 | add_test(NAME tests COMMAND tests) |