From b684c077f6df057d60ec9a0d80f257d2709747d8 Mon Sep 17 00:00:00 2001 From: McMassiveNZ <12842622+McMassiveNZ@users.noreply.github.com> Date: Mon, 29 May 2023 10:08:52 +0200 Subject: [PATCH] Revert googletest.cmake Continue to use FetchContent for google test stuff. CPM seems to be doing something which stops it from compiling on Ubuntu with LLVM --- cmake/googletest.cmake | 19 +++++++++---------- src/main.cpp | 1 - 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/cmake/googletest.cmake b/cmake/googletest.cmake index 1a971fe..40d9a4a 100644 --- a/cmake/googletest.cmake +++ b/cmake/googletest.cmake @@ -1,18 +1,17 @@ include_guard() -CPMAddPackage( - NAME googletest - GITHUB_REPOSITORY google/googletest - GIT_TAG v1.13.0 - VERSION 1.13.0 - OPTIONS - "INSTALL_GTEST OFF" - "gtest_force_shared_crt ON" +include(FetchContent) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # release-1.12.1 ) - +# For Windows: Prevent overriding the parent project's compiler/linker settings +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) set_property(TARGET gtest gtest_main gmock gmock_main - PROPERTY FOLDER third_party/GoogleTest) + PROPERTY FOLDER third_party/GoogleTest) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 28d95e4..4cae0ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,5 @@ auto main() -> int { fmt::print("Hello, World!"); - return 0; }