diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-03-23 08:10:49 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-03-23 08:10:49 +0100 |
| commit | 754012dd458985a6a4953c99204c6651318892b2 (patch) | |
| tree | 3c654198ae6704137d6da8f9396f3e8970630ea0 /CMakeLists.txt | |
| parent | c9ce8625dd80f701e280f90cb30c30f8663473e9 (diff) | |
| download | teachos-754012dd458985a6a4953c99204c6651318892b2.tar.xz teachos-754012dd458985a6a4953c99204c6651318892b2.zip | |
testing: enable build-host testing
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7654ed0..f4c3762 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,21 @@ include("ElfTransformations") include("GenerateBootableIso") #[============================================================================[ +# External Dependencies +#]============================================================================] + +include("FetchContent") + +FetchContent_Declare( + "Catch2" + GIT_REPOSITORY "https://github.com/catchorg/Catch2.git" + GIT_TAG "v3.13.0" + FIND_PACKAGE_ARGS +) + +FetchContent_MakeAvailable("Catch2") + +#[============================================================================[ # Global Build System Options #]============================================================================] @@ -70,7 +85,20 @@ endif() # Global Targets #]============================================================================] -add_subdirectory("arch/${CMAKE_SYSTEM_PROCESSOR}") -add_subdirectory("kapi") -add_subdirectory("libs") -add_subdirectory("kernel")
\ No newline at end of file +if(CMAKE_CROSSCOMPILING) + add_subdirectory("arch/${CMAKE_SYSTEM_PROCESSOR}") + add_subdirectory("kernel") + add_subdirectory("kapi") + add_subdirectory("libs") +else() + enable_testing() + find_package("Catch2") + include("Catch") + + set_target_properties("Catch2" "Catch2WithMain" PROPERTIES + C_CLANG_TIDY "" + CXX_CLANG_TIDY "" + ) + + add_subdirectory("libs") +endif() |
