mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-21 19:20:07 +00:00
build: cmake: support passing a custom source folder for GoogleTest (#5157)
This commit is contained in:
parent
8e6563b913
commit
44bc9bd2af
6
external/CMakeLists.txt
vendored
6
external/CMakeLists.txt
vendored
@ -56,7 +56,9 @@ if (NOT ${SPIRV_SKIP_TESTS})
|
||||
if (TARGET gmock)
|
||||
message(STATUS "Google Mock already configured")
|
||||
else()
|
||||
set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
|
||||
if (NOT GMOCK_DIR)
|
||||
set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
|
||||
endif()
|
||||
if(EXISTS ${GMOCK_DIR})
|
||||
if(MSVC)
|
||||
# Our tests use ::testing::Combine. Work around a compiler
|
||||
@ -73,7 +75,7 @@ if (NOT ${SPIRV_SKIP_TESTS})
|
||||
# gtest requires special defines for building as a shared
|
||||
# library, simply always build as static.
|
||||
push_variable(BUILD_SHARED_LIBS 0)
|
||||
add_subdirectory(${GMOCK_DIR} EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(${GMOCK_DIR} ${CMAKE_CURRENT_BINARY_DIR}/googletest EXCLUDE_FROM_ALL)
|
||||
pop_variable(BUILD_SHARED_LIBS)
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user