mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
CMake: Force gtest to link CRT dynamically to avoid runtime mismatches
Required to fix unit test builds for Windows+MSVC+CMake. For more information, see: https://github.com/google/googletest/blob/23ef29555ef4789f555f1ba8c51b4c52975f0907/googletest/README.md#visual-studio-dynamic-vs-static-runtimes
This commit is contained in:
@@ -844,6 +844,8 @@ include_directories("${PROJECT_BINARY_DIR}/Source/Core")
|
||||
#
|
||||
if(ENABLE_TESTS)
|
||||
message(STATUS "Using static gtest from Externals")
|
||||
# Force gtest to link the C runtime dynamically on Windows in order to avoid runtime mismatches.
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
add_subdirectory(Externals/gtest EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
message(STATUS "Unit tests are disabled")
|
||||
|
||||
Reference in New Issue
Block a user