diff --git a/CMakeLists.txt b/CMakeLists.txt index 109645fb9fe..c86c217c2b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3) +CMAKE_MINIMUM_REQUIRED(VERSION 3.8) PROJECT(lmms) diff --git a/include/stdshims.h b/include/stdshims.h deleted file mode 100644 index dc89a1b0933..00000000000 --- a/include/stdshims.h +++ /dev/null @@ -1,30 +0,0 @@ -//! Shims for std:: functions that aren't available in the current C++ versions -//! we target. - -#ifndef STDSHIMS_H -#define STDSHIMS_H - -#include -#include - -#if (__cplusplus >= 201703L || _MSC_VER >= 1914) -#ifndef _MSC_VER -#warning "This part of this file should now be removed! The functions it provides are part of the C++17 standard." -#endif -using std::as_const; - -#else - -/// Shim for http://en.cppreference.com/w/cpp/utility/as_const -template -constexpr typename std::add_const::type& as_const(T& t) noexcept -{ - return t; -} - -template -void as_const(const T&&) = delete; -#endif - -#endif // include guard - diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index dde913d56ef..cad7c00b4c0 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -2,8 +2,8 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") SET(CMAKE_DEBUG_POSTFIX "") -# Enable C++14 -SET(CMAKE_CXX_STANDARD 14) +# Enable C++17 +SET(CMAKE_CXX_STANDARD 17) IF(LMMS_BUILD_APPLE) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") diff --git a/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt b/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt index aa77459b68a..f916c694cd1 100644 --- a/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt +++ b/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(RemoteVstPlugin LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) include(CheckCXXPreprocessor) include(CheckCXXSourceCompiles) @@ -55,7 +55,7 @@ if(WIN32) endif() if(IS_MINGW) - SET(CMAKE_REQUIRED_FLAGS "-std=c++14") + SET(CMAKE_REQUIRED_FLAGS "-std=c++17") CHECK_CXX_SOURCE_COMPILES(" #include diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 09f490bc64e..97c3fd19809 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,8 +9,8 @@ SET(LMMS_UIS "") SET(CMAKE_AUTOMOC ON) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -# Enable C++14 -SET(CMAKE_CXX_STANDARD 14) +# Enable C++17 +SET(CMAKE_CXX_STANDARD 17) IF(LMMS_BUILD_APPLE) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") diff --git a/src/core/LinkedModelGroups.cpp b/src/core/LinkedModelGroups.cpp index c9bbc475a8f..d0bcd8cfd11 100644 --- a/src/core/LinkedModelGroups.cpp +++ b/src/core/LinkedModelGroups.cpp @@ -28,7 +28,6 @@ #include #include "AutomatableModel.h" -#include "stdshims.h" diff --git a/src/gui/widgets/ControlLayout.cpp b/src/gui/widgets/ControlLayout.cpp index aa265b14e5b..0885c3c449e 100644 --- a/src/gui/widgets/ControlLayout.cpp +++ b/src/gui/widgets/ControlLayout.cpp @@ -73,13 +73,12 @@ #include "ControlLayout.h" -#include "stdshims.h" - #include #include #include #include #include +#include constexpr const int ControlLayout::m_minWidth; @@ -215,7 +214,7 @@ QSize ControlLayout::minimumSize() const // get maximum height and width for all children. // as Qt will later call heightForWidth, only the width here really matters QSize size; - for (const QLayoutItem *item : as_const(m_itemMap)) + for (const QLayoutItem *item : std::as_const(m_itemMap)) { size = size.expandedTo(item->minimumSize()); } diff --git a/src/gui/widgets/Knob.cpp b/src/gui/widgets/Knob.cpp index ec96b0698d3..35c2bfc1308 100644 --- a/src/gui/widgets/Knob.cpp +++ b/src/gui/widgets/Knob.cpp @@ -47,7 +47,6 @@ #include "MainWindow.h" #include "ProjectJournal.h" #include "Song.h" -#include "stdshims.h" #include "StringPairDrag.h" #include "TextFloat.h" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 823f553b1b2..6ff9c41e967 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,7 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include") INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}") INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/src") -SET(CMAKE_CXX_STANDARD 14) +SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_AUTOMOC ON)