From c7083ae3e8a30e1a6b7ec7d95f2b8b2f049bf874 Mon Sep 17 00:00:00 2001 From: Amber Date: Sat, 18 Nov 2023 17:24:03 -0500 Subject: [PATCH] Ensure dependencies are met for windows build pipeline --- tests/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ac3c242..f01de33 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.20) +# fetch google test to use for testing include(FetchContent) FetchContent_Declare( @@ -10,10 +11,16 @@ FetchContent_Declare( FetchContent_MakeAvailable(googletest) +# Add test executables add_executable(self_test self_test.cpp) add_executable(C_Callback_test test_C_Callback.cpp) + +# Link against google test and the C_Callback library target_link_libraries(self_test gtest_main) target_link_libraries(C_Callback_test gtest_main C_Callback) +# Ensure that C_Callback is built before the tests +add_dependencies(C_Callback_test C_Callback) + add_test(NAME self_test COMMAND self_test) add_test(NAME C_Callback_test COMMAND C_Callback_test)