Make test suite optional by using CTest

This commit is contained in:
David Seifert 2017-04-28 22:46:52 +02:00
parent 5a5699bdbd
commit 8f824265ea
3 changed files with 83 additions and 76 deletions

View File

@ -15,6 +15,9 @@ option(ENABLE_HLSL "Enables HLSL input support" ON)
project(glslang)
# make testing optional
include(CTest)
if(ENABLE_AMD_EXTENSIONS)
add_definitions(-DAMD_EXTENSIONS)
endif(ENABLE_AMD_EXTENSIONS)

View File

@ -1,6 +1,7 @@
# Suppress all warnings from external projects.
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w)
if(BUILD_TESTING)
if(TARGET gmock)
message(STATUS "Google Mock already configured - use it")
elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
@ -31,3 +32,4 @@ else()
message(STATUS
"Google Mock was not found - tests based on that will not build")
endif()
endif()

View File

@ -1,3 +1,4 @@
if(BUILD_TESTING)
if(TARGET gmock)
message(STATUS "Google Mock found - building tests")
@ -53,3 +54,4 @@ if (TARGET gmock)
add_test(NAME glslang-gtests
COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}")
endif()
endif()