The NEW behavior is to not dereference variables or interpret keywords
that have been quoted or bracketed.
For more information, see
https://cmake.org/cmake/help/v3.1/policy/CMP0054.html.
This is to suppress a warning when using CMake 3.1.3+.
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
cmake_minimum_required(VERSION 2.8.12)
+if (POLICY CMP0054)
+ # Avoid dereferencing variables or interpret keywords that have been
+ # quoted or bracketed.
+ # https://cmake.org/cmake/help/v3.1/policy/CMP0054.html
+ cmake_policy(SET CMP0054 NEW)
+endif()
+
project(spirv-tools)
enable_testing()
set(SPIRV_TOOLS "SPIRV-Tools")
endif()
option(SPIRV_WERROR "Enable error on warning" ON)
-if((${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
+if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
set(COMPILER_IS_LIKE_GNU TRUE)
endif()
if(${COMPILER_IS_LIKE_GNU})
if(${COMPILER_IS_LIKE_GNU})
target_compile_options(${ARG_TARGET} PRIVATE -Wno-undef)
endif()
- if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Disable C4503 "decorated name length exceeded" warning,
# triggered by some heavily templated types.
# We don't care much about that in test code.