Skip to content

Commit 2eb919b

Browse files
committed
cmake: Build gtest and benchmark as shared lib with MSVC
should fix `gmock.lib(gtest-all.obj) : error LNK2005`
1 parent ee6c8cc commit 2eb919b

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

cmake/dependencies/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,7 @@ if(BUILD_googletest)
413413
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
414414
set(INSTALL_GTEST OFF)
415415
set(GTEST_HAS_ABSL ON)
416-
if(WIN32)
417-
set(BUILD_SHARED_LIBS OFF)
418-
endif()
419416
FetchContent_MakeAvailable(googletest)
420-
if(WIN32)
421-
set(BUILD_SHARED_LIBS ON)
422-
endif()
423-
424417
list(POP_BACK CMAKE_MESSAGE_INDENT)
425418
message(CHECK_PASS "fetched")
426419
endif()
@@ -438,13 +431,7 @@ if(BUILD_benchmark)
438431
set(BENCHMARK_ENABLE_TESTING OFF)
439432
set(BENCHMARK_ENABLE_WERROR OFF)
440433
set(BENCHMARK_ENABLE_INSTALL OFF)
441-
if(WIN32)
442-
set(BUILD_SHARED_LIBS OFF)
443-
endif()
444434
FetchContent_MakeAvailable(benchmark)
445-
if(WIN32)
446-
set(BUILD_SHARED_LIBS ON)
447-
endif()
448435
list(POP_BACK CMAKE_MESSAGE_INDENT)
449436
message(CHECK_PASS "fetched")
450437
endif()

0 commit comments

Comments
 (0)