mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
Unittests: Always use GTest from Externals (recommended way from GTest FAQ).
This commit is contained in:
@ -468,21 +468,6 @@ if(NOT ANDROID)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
########################################
|
||||
# Unit testing: only enabled if GTest is present.
|
||||
#
|
||||
add_custom_target(unittests)
|
||||
include(FindGTest OPTIONAL)
|
||||
if(GTEST_FOUND)
|
||||
enable_testing()
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
|
||||
message("GTest found, unit tests can be compiled and ran with 'make unittests'")
|
||||
else()
|
||||
add_custom_command(TARGET unittests POST_BUILD COMMAND echo Running unittests requires GTest.)
|
||||
message("GTest NOT found, disabling unit tests")
|
||||
endif(GTEST_FOUND)
|
||||
|
||||
########################################
|
||||
# Setup include directories (and make sure they are preferred over the Externals)
|
||||
#
|
||||
@ -738,6 +723,16 @@ file(WRITE ${PROJECT_BINARY_DIR}/Source/Core/Common/scmrev.h
|
||||
)
|
||||
include_directories("${PROJECT_BINARY_DIR}/Source/Core/Common")
|
||||
|
||||
########################################
|
||||
# Unit testing.
|
||||
#
|
||||
include_directories(Externals/gtest/include)
|
||||
add_subdirectory(Externals/gtest)
|
||||
|
||||
enable_testing()
|
||||
add_custom_target(unittests)
|
||||
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
|
||||
|
||||
|
||||
########################################
|
||||
# Start compiling our code
|
||||
|
Reference in New Issue
Block a user