Skip to content
Permalink
Browse files

Enable C++17

All supported platforms now have easy access to a compiler with C++17
support.

C++17 potentially allows for some nice cleanups and removes the need
for standard library backports (optional/variant).

See discussion at https://dolp.in/pr6264#discussion_r158134178
  • Loading branch information...
leoetlino committed Dec 25, 2017
1 parent 99a4ca8 commit 04c8201c323bd5cb7fd09beb456e4e77608270f7
Showing with 4 additions and 3,484 deletions.
  1. +4 −9 Source/CMakeLists.txt
  2. +0 −45 Source/Core/Common/Compat/in_place.h
  3. +0 −907 Source/Core/Common/Compat/optional
  4. +0 −2,523 Source/Core/Common/Compat/variant
@@ -16,18 +16,13 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
check_and_add_flag(CPPLATEST /std:c++latest)
check_and_add_flag(STANDARD_COMPLIANCE /permissive-)
else()
# Enable C++17, but fall back to C++14 if it isn't available.
# CMAKE_CXX_STANDARD cannot be used here because we require C++14 or newer, not any standard.
# Enable C++17
# CMAKE_CXX_STANDARD cannot be used because it requires cmake 3.8+.
check_and_add_flag(CXX17 -std=c++17)
if(NOT FLAG_CXX_CXX17)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Fall back to -std=c++1z
check_and_add_flag(CXX1Z -std=c++1z)
endif()

# These compat headers must not be in the include path when building with MSVC,
# because it currently does not support __has_include_next / #include_next.
include_directories(SYSTEM Core/Common/Compat)
endif()

# These aren't actually needed for C11/C++11

This file was deleted.

0 comments on commit 04c8201

Please sign in to comment.
You can’t perform that action at this time.