Skip to content

Commit f49bb3c

Browse files
authored
[C++17] Remove std option for linux build (microsoft#5582)
Use CMAKE_CXX_STANDARD instead of -std=c++14 for linux. Dependent on microsoft#5520 Fixes microsoft#5479
1 parent 64348c7 commit f49bb3c

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
391391
# Colorize GCC output even with ninja's stdout redirection.
392392
if (CMAKE_COMPILER_IS_GNUCXX)
393393
append("-fdiagnostics-color" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
394-
append("-std=c++11" CMAKE_CXX_FLAGS)
395394
endif (CMAKE_COMPILER_IS_GNUCXX)
396395

397396
# Turn off missing field initializer warnings for gcc to avoid noise from
@@ -453,23 +452,7 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
453452
if (NOT LLVM_ENABLE_TIMESTAMPS)
454453
add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
455454
endif ()
456-
if (LLVM_ENABLE_CXX1Y)
457-
check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
458-
append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)
459-
else()
460-
check_cxx_compiler_flag("-std=c++14" CXX_SUPPORTS_CXX14)
461-
if (CXX_SUPPORTS_CXX14)
462-
if (CYGWIN OR MINGW)
463-
# MinGW and Cygwin are a bit stricter and lack things like
464-
# 'strdup', 'stricmp', etc in c++11 mode.
465-
append("-std=gnu++14" CMAKE_CXX_FLAGS)
466-
else()
467-
append("-std=c++14" CMAKE_CXX_FLAGS)
468-
endif()
469-
else()
470-
message(FATAL_ERROR "LLVM requires C++11 support but the '-std=c++14' flag isn't supported.")
471-
endif()
472-
endif()
455+
473456
if (LLVM_ENABLE_MODULES)
474457
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
475458
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fmodules -fcxx-modules")

0 commit comments

Comments
 (0)