Skip to content

Commit

Permalink
Require C++11 *or later* (#5020)
Browse files Browse the repository at this point in the history
Allow externally setting CMAKE_CXX_STANDARD to 14, for example,
which is needed to build protobufs
  • Loading branch information
dneto0 authored Dec 16, 2022
1 parent 43c99b5 commit 5d6adbd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ set(SPIRV_TOOLS "SPIRV-Tools")
include(GNUInstallDirs)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 11)

# Require at least C++11
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
if(${CMAKE_CXX_STANDARD} LESS 11)
message(FATAL_ERROR "SPIRV-Tools requires C++11 or later, but is configured for C++${CMAKE_CXX_STANDARD})")
endif()


option(ENABLE_RTTI "Enables RTTI" OFF)
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
Expand Down

0 comments on commit 5d6adbd

Please sign in to comment.