mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-15 16:33:15 -03:00
Merge pull request #14252 from Dentomologist/set_standard_to_c++23
Set standard to c++23 for non-MSVC compilers
This commit is contained in:
@@ -1,23 +1,10 @@
|
||||
########################################
|
||||
# General setup
|
||||
#
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
cmake_minimum_required(VERSION 3.20...4.2.1)
|
||||
|
||||
cmake_policy(SET CMP0079 NEW) # let target_link_libraries() link to a target defined in a different directory
|
||||
cmake_policy(SET CMP0080 OLD) # allow using BundleUtilities at configure time
|
||||
|
||||
if (POLICY CMP0099)
|
||||
cmake_policy(SET CMP0099 NEW) # Propagate INTERFACE_LINK_OPTIONS from private dependencies, used by MacOS framework builds of SDL
|
||||
endif()
|
||||
|
||||
# Weird chicken-and-egg problem: We can't check the compiler before the project() call, but we have to set the policies before it.
|
||||
# So we do this in two steps: Set the policies if they exist, then error out afterwards if we end up being MSVC and they don't exist.
|
||||
if (POLICY CMP0117)
|
||||
cmake_policy(SET CMP0091 NEW) # MSVC runtime library flags are selected by an abstraction.
|
||||
cmake_policy(SET CMP0092 NEW) # MSVC warning flags are not in CMAKE_{C,CXX}_FLAGS by default.
|
||||
cmake_policy(SET CMP0117 NEW) # MSVC RTTI flag will not be added by default.
|
||||
endif()
|
||||
|
||||
if (POLICY CMP0141)
|
||||
cmake_policy(SET CMP0141 NEW) # MSVC debug information format flags are selected by an abstraction.
|
||||
endif()
|
||||
@@ -28,6 +15,12 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0.0" CACHE STRING "")
|
||||
|
||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FlagsOverride.cmake")
|
||||
|
||||
# CMake 3.28 and later scan c++ source files for module imports by default. Since we don't use
|
||||
# modules scanning is pointless, so disable it. This also prevents Clang from generating an error
|
||||
# if the clang-scan-deps tool isn't installed:
|
||||
# "CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND: not found".
|
||||
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
|
||||
|
||||
project(dolphin-emu)
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "3.25" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
@@ -35,12 +28,6 @@ if (CMAKE_VERSION VERSION_LESS "3.25" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
if (POLICY CMP0117)
|
||||
# cmake is a weird language. You can't do if(not POLICY)
|
||||
else()
|
||||
message(FATAL_ERROR "Please update to CMake 3.20 or higher.")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
@@ -16,7 +16,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
@@ -33,6 +33,11 @@ VolumeFileBlobReader::VolumeFileBlobReader(const Volume& volume, const Partition
|
||||
{
|
||||
}
|
||||
|
||||
// This is defined here instead of the header so that the definition of FileInfo is visible when
|
||||
// m_file_info is destroyed, preventing a compile error caused by calling unique_ptr's destructor
|
||||
// with an incomplete type.
|
||||
VolumeFileBlobReader::~VolumeFileBlobReader() = default;
|
||||
|
||||
std::unique_ptr<BlobReader> VolumeFileBlobReader::CopyReader() const
|
||||
{
|
||||
ASSERT_MSG(DISCIO, false, "Unimplemented");
|
||||
|
||||
@@ -20,6 +20,7 @@ class VolumeFileBlobReader final : public BlobReader
|
||||
public:
|
||||
static std::unique_ptr<VolumeFileBlobReader>
|
||||
Create(const Volume& volume, const Partition& partition, std::string_view file_path);
|
||||
~VolumeFileBlobReader();
|
||||
|
||||
BlobType GetBlobType() const override { return BlobType::PLAIN; }
|
||||
std::unique_ptr<BlobReader> CopyReader() const override;
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
if(POLICY CMP0084)
|
||||
# Disable trying to search for Qt3/4 if what we actually want is not found
|
||||
cmake_policy(SET CMP0084 NEW)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
if(_M_ARM_64)
|
||||
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.5.1/ARM64")
|
||||
|
||||
@@ -27,16 +27,6 @@ std::unique_ptr<Metal::ObjectCache> Metal::g_object_cache;
|
||||
static void SetupDepthStencil(
|
||||
MRCOwned<id<MTLDepthStencilState>> (&dss)[Metal::DepthStencilSelector::N_VALUES]);
|
||||
|
||||
Metal::ObjectCache::ObjectCache()
|
||||
{
|
||||
m_internal = std::make_unique<Internal>();
|
||||
SetupDepthStencil(m_dss);
|
||||
}
|
||||
|
||||
Metal::ObjectCache::~ObjectCache()
|
||||
{
|
||||
}
|
||||
|
||||
void Metal::ObjectCache::Initialize(MRCOwned<id<MTLDevice>> device)
|
||||
{
|
||||
g_device = std::move(device);
|
||||
@@ -554,6 +544,17 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
Metal::ObjectCache::ObjectCache()
|
||||
{
|
||||
m_internal = std::make_unique<Internal>();
|
||||
SetupDepthStencil(m_dss);
|
||||
}
|
||||
|
||||
// This is defined here instead of the header so that the definition of Internal is visible when
|
||||
// m_internal is destroyed, preventing a compile error caused by calling unique_ptr's destructor
|
||||
// with an incomplete type.
|
||||
Metal::ObjectCache::~ObjectCache() = default;
|
||||
|
||||
std::unique_ptr<AbstractPipeline>
|
||||
Metal::ObjectCache::CreatePipeline(const AbstractPipelineConfig& config)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user