From 48e22ec9305ac05b389c76e2c977d6ab45a9059f Mon Sep 17 00:00:00 2001 From: Paul Nykiel Date: Thu, 29 Dec 2022 21:44:52 +0100 Subject: [PATCH] #45: Maybe fixed build in CI --- Tests/LowLevel/Mock/CMakeLists.txt | 19 ++++++++++--------- Tests/LowLevel/Mock/Lib/CMakeLists.txt | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Tests/LowLevel/Mock/CMakeLists.txt b/Tests/LowLevel/Mock/CMakeLists.txt index 5912fec8..9d8bfb5f 100644 --- a/Tests/LowLevel/Mock/CMakeLists.txt +++ b/Tests/LowLevel/Mock/CMakeLists.txt @@ -1,3 +1,13 @@ +# Download GTest +include(FetchContent) +FetchContent_Declare( + gtest + GIT_REPOSITORY "https://github.com/google/googletest.git" + GIT_TAG "main" +) +FetchContent_MakeAvailable(gtest) + +# Load mocking lib add_subdirectory(Lib) set(MockedModules @@ -84,15 +94,6 @@ foreach (MockedModule ${MockedSystemModules}) target_include_directories(${MockLibTarget} INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/Mock) endforeach () -# Download GTest -include(FetchContent) -FetchContent_Declare( - gtest - GIT_REPOSITORY "https://github.com/google/googletest.git" - GIT_TAG "main" -) -FetchContent_MakeAvailable(gtest) - set(AllTests) # Function to build a mock test for a module diff --git a/Tests/LowLevel/Mock/Lib/CMakeLists.txt b/Tests/LowLevel/Mock/Lib/CMakeLists.txt index 2efef153..d504242c 100644 --- a/Tests/LowLevel/Mock/Lib/CMakeLists.txt +++ b/Tests/LowLevel/Mock/Lib/CMakeLists.txt @@ -2,3 +2,4 @@ project(MockLib) add_library(${PROJECT_NAME} INTERFACE) target_include_directories(${PROJECT_NAME} INTERFACE ..) +target_link_libraries(${PROJECT_NAME} PUBLIC gtest gmock pthread)