mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Do not hard fail when running 'make unittests' without GTest.
This commit is contained in:
parent
6176424ac4
commit
2d71571be5
@ -331,15 +331,6 @@ if(NOT OPENMP_FOUND)
|
||||
message("OpenMP parallelization disabled")
|
||||
endif()
|
||||
|
||||
include(FindGTest OPTIONAL)
|
||||
if(GTEST_FOUND)
|
||||
enable_testing()
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
message("GTest found, unit tests can be compiled and ran with 'make unittests'")
|
||||
else()
|
||||
message("GTest NOT found, disabling unit tests")
|
||||
endif(GTEST_FOUND)
|
||||
|
||||
if(NOT ANDROID)
|
||||
|
||||
include(FindOpenGL)
|
||||
@ -477,6 +468,21 @@ 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)
|
||||
#
|
||||
|
@ -1,6 +1,3 @@
|
||||
add_custom_target(unittests)
|
||||
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
|
||||
|
||||
macro(add_dolphin_test target srcs libs)
|
||||
add_executable(Tests/${target} EXCLUDE_FROM_ALL ${srcs})
|
||||
target_link_libraries(Tests/${target} ${libs} ${GTEST_BOTH_LIBRARIES})
|
||||
|
Loading…
Reference in New Issue
Block a user