From 50077b4853e46156784ffad5c5b566addbf464e1 Mon Sep 17 00:00:00 2001 From: Moritz Date: Sat, 30 Aug 2025 12:10:03 +0200 Subject: [PATCH] set c++ standard exactly to 14. The standard is set globally for the project. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbb0f1aa28..75b797c362 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ option(NINJA_FORCE_PSELECT "Use pselect() even on platforms that provide ppoll() project(ninja CXX) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + # --- optional link-time optimization check_ipo_supported(RESULT lto_supported OUTPUT error) @@ -191,9 +195,6 @@ else() endif() endif() -target_compile_features(libninja PUBLIC cxx_std_14) -target_compile_features(libninja-re2c PUBLIC cxx_std_14) - #Fixes GetActiveProcessorCount on MinGW if(MINGW) target_compile_definitions(libninja PRIVATE _WIN32_WINNT=0x0601 __USE_MINGW_ANSI_STDIO=1)