Skip to content

Commit 50077b4

Browse files
committed
set c++ standard exactly to 14. The standard is set globally for the project.
1 parent eac306c commit 50077b4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ option(NINJA_FORCE_PSELECT "Use pselect() even on platforms that provide ppoll()
88

99
project(ninja CXX)
1010

11+
set(CMAKE_CXX_STANDARD 14)
12+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
13+
set(CMAKE_CXX_EXTENSIONS OFF)
14+
1115
# --- optional link-time optimization
1216
check_ipo_supported(RESULT lto_supported OUTPUT error)
1317

@@ -191,9 +195,6 @@ else()
191195
endif()
192196
endif()
193197

194-
target_compile_features(libninja PUBLIC cxx_std_14)
195-
target_compile_features(libninja-re2c PUBLIC cxx_std_14)
196-
197198
#Fixes GetActiveProcessorCount on MinGW
198199
if(MINGW)
199200
target_compile_definitions(libninja PRIVATE _WIN32_WINNT=0x0601 __USE_MINGW_ANSI_STDIO=1)

0 commit comments

Comments
 (0)