Add GLSLANG_TESTS option

1 variable instead of ENABLE_CTEST and BUILD_TESTING.

OFF by default. See README.md for explanation.
This commit is contained in:
Juan Ramos 2023-11-30 12:33:36 -07:00 committed by arcady-lunarg
parent e854c8de10
commit 3b99124593
5 changed files with 22 additions and 23 deletions

View file

@ -70,11 +70,11 @@ endif()
# Furthermore testing is equally problematic.
if (IOS OR ANDROID)
set(ENABLE_GLSLANG_BINARIES OFF)
set(ENABLE_CTEST OFF)
set(BUILD_TESTING OFF)
set(GLSLANG_TESTS OFF)
endif()
option(GLSLANG_TESTS "Enable glslang testing")
option(SKIP_GLSLANG_INSTALL "Skip installation")
if(NOT ${SKIP_GLSLANG_INSTALL})
@ -107,11 +107,6 @@ if(MINGW OR (APPLE AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU"))
endif()
option(ENABLE_PCH "Enables Precompiled header" ON)
option(ENABLE_CTEST "Enables testing" ON)
if(ENABLE_CTEST)
include(CTest)
endif()
if(ENABLE_HLSL)
add_compile_definitions(ENABLE_HLSL)
@ -306,11 +301,11 @@ if(ENABLE_GLSLANG_BINARIES)
add_subdirectory(StandAlone)
endif()
add_subdirectory(SPIRV)
if(ENABLE_CTEST)
add_subdirectory(gtests)
endif()
if(ENABLE_CTEST AND BUILD_TESTING)
if(GLSLANG_TESTS)
enable_testing()
add_subdirectory(gtests)
# glslang-testsuite runs a bash script on Windows.
# Make sure to use '-o igncr' flag to ignore carriage returns (\r).
set(IGNORE_CR_FLAG "")