diff --git a/external/cmdline.h b/external/cmdline.h index f498b66..f6b3b9b 100644 --- a/external/cmdline.h +++ b/external/cmdline.h @@ -39,8 +39,12 @@ #ifdef _MSC_VER #define NOMINMAX -#include +/* + You must include Windows.h before DbgHelp.h. + See https://stackoverflow.com/a/43283926/1014818 for more details. +*/ #include +#include #else #include #endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 866092c..6224acb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,7 +3,13 @@ enable_testing() # GTest setup set(GTEST_DIR "lib/googletest") execute_process(COMMAND git submodule update --init -- test/${GTEST_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + message(STATUS "Adding ${GTEST_DIR}") + +# Prevent overriding the parent project's compiler/linker settings on Windows +# See https://github.com/google/googletest/blob/master/googletest/README.md#visual-studio-dynamic-vs-static-runtimes +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + add_subdirectory(${GTEST_DIR} EXCLUDE_FROM_ALL) # filesystem setup diff --git a/test/lib/googletest b/test/lib/googletest index ba96d0b..2fe3bd9 160000 --- a/test/lib/googletest +++ b/test/lib/googletest @@ -1 +1 @@ -Subproject commit ba96d0b1161f540656efdaed035b3c062b60e006 +Subproject commit 2fe3bd994b3189899d93f1d5a881e725e046fdc2