Skip to content

Commit 8246864

Browse files
committed
[CMake] Set the C++ standard to C++14
Swift inherited C++14 when LLVM made the switch. However, the C++ standard is not set in the Swift project itself. This lead to compile errors for files that include C++11 incompatible code.
1 parent e650e09 commit 8246864

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ endif()
2727

2828
ENABLE_LANGUAGE(C)
2929

30+
# Use C++14.
31+
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
32+
set(CMAKE_CXX_STANDARD_REQUIRED YES)
33+
set(CMAKE_CXX_EXTENSIONS NO)
34+
3035
# First include general CMake utilities.
3136
include(SwiftUtils)
3237
include(CheckSymbolExists)

0 commit comments

Comments
 (0)