mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
// MPark.Variant
|
||||
//
|
||||
// Copyright Michael Park, 2015-2017
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace mpark
|
||||
{
|
||||
struct in_place_t
|
||||
{
|
||||
explicit in_place_t() = default;
|
||||
};
|
||||
|
||||
template <std::size_t I>
|
||||
struct in_place_index_t
|
||||
{
|
||||
explicit in_place_index_t() = default;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct in_place_type_t
|
||||
{
|
||||
explicit in_place_type_t() = default;
|
||||
};
|
||||
|
||||
#ifdef MPARK_VARIABLE_TEMPLATES
|
||||
constexpr in_place_t in_place{};
|
||||
|
||||
template <std::size_t I>
|
||||
constexpr in_place_index_t<I> in_place_index{};
|
||||
|
||||
template <typename T>
|
||||
constexpr in_place_type_t<T> in_place_type{};
|
||||
#endif
|
||||
|
||||
} // namespace mpark
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user