Skip to content

Commit

Permalink
Fix gtest CMake target: do not add 'd' postfix on debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrl-z-9000-times committed Sep 3, 2024
1 parent 53c7547 commit 9f7952a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions external/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ set(BUILD_GMOCK OFF CACHE BOOL "prevents building gmock" FORCE)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})

if(MSVC)
set(gtest_LIBRARIES ${REPOSITORY_DIR}/build/ThirdParty/lib/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>/${CMAKE_STATIC_LIBRARY_PREFIX}gtest$<$<CONFIG:Debug>:d>${CMAKE_STATIC_LIBRARY_SUFFIX})
set(gtest_LIBRARIES ${REPOSITORY_DIR}/build/ThirdParty/lib/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
else()
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(DEBUG_POSTFIX d)
endif()
set(gtest_LIBRARIES ${REPOSITORY_DIR}/build/ThirdParty/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest$<$<CONFIG:Debug>:d>${CMAKE_STATIC_LIBRARY_SUFFIX})
set(gtest_LIBRARIES ${REPOSITORY_DIR}/build/ThirdParty/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
FILE(APPEND "${EXPORT_FILE_NAME}" "gtest_INCLUDE_DIRS@@@${googletest_SOURCE_DIR}/googletest/include\n")
FILE(APPEND "${EXPORT_FILE_NAME}" "gtest_LIBRARIES@@@${gtest_LIBRARIES}\n")
Expand Down

0 comments on commit 9f7952a

Please sign in to comment.