Skip to content

Commit

Permalink
Try other CMake approach.
Browse files Browse the repository at this point in the history
  • Loading branch information
breyerml committed Feb 16, 2025
1 parent 41f8954 commit 3c7710a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ else ()
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/breyerml/googletest.git
GIT_TAG windows-msvc-fix
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG ${PLSSVM_googletest_VERSION}
GIT_SHALLOW TRUE
QUIET
)
Expand All @@ -36,11 +36,11 @@ else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_OLD}")

# try fixing MSVC Windows problem
# if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# message(STATUS "Change GTEST_API_ in the gtest_main.cc file.")
# message(STATUS "${googletest_SOURCE_DIR}/googletest/src/gtest_main.cc")
# set_source_files_properties("${googletest_SOURCE_DIR}/googletest/src/gtest_main.cc" PROPERTIES COMPILE_DEFINITIONS GTEST_API_="")
# endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message(STATUS "Change GTEST_API_ in the gtest_main.cc file.")
message(STATUS "${googletest_SOURCE_DIR}/googletest/src/gtest_main.cc")
set_source_files_properties("${googletest_SOURCE_DIR}/googletest/src/gtest_main.cc" PROPERTIES COMPILE_DEFINITIONS "GTEST_API_=")
endif ()
endif ()

# create larger test files if desired
Expand Down

0 comments on commit 3c7710a

Please sign in to comment.