diff --git a/CMakeLists.txt b/CMakeLists.txt index fa21c5161e..c9671d71cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ include(Pcsx2Utils) check_no_parenthesis_in_path() detectOperatingSystem() -check_compiler_version("4.8" "4.8") +check_compiler_version("7.0" "7.0") #------------------------------------------------------------------------------- # Include specific module diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index bd102b6a7e..195315e12e 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -391,7 +391,7 @@ endif() # Note: -DGTK_DISABLE_DEPRECATED can be used to test a build without gtk deprecated feature. It could be useful to port to a newer API set(DEFAULT_GCC_FLAG "${ARCH_FLAG} ${COMMON_FLAG} ${DEFAULT_WARNINGS} ${AGGRESSIVE_WARNING} ${HARDENING_FLAG} ${DEBUG_FLAG} ${ASAN_FLAG} ${OPTIMIZATION_FLAG} ${LTO_FLAGS} ${PGO_FLAGS} ${PLUGIN_SUPPORT}") # c++ only flags -set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -std=c++11 -Wno-invalid-offsetof") +set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof") #------------------------------------------------------------------------------- # Allow user to set some default flags diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 03aee64370..47a3b83ccc 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -733,6 +733,7 @@ if(USE_VTUNE) endif() add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}") +target_compile_features(${Output} PRIVATE cxx_std_17) if(COMMAND target_precompile_headers) message("Using precompiled headers.") diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 22edc276c2..3f1a9bc862 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -262,12 +262,16 @@ else() # Don't append -SSE2 on the first build to keep same name as SIMD build add_pcsx2_plugin("${Output}" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}") add_pcsx2_plugin("${Output}-SSE4" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags} -mssse3 -msse4 -msse4.1") + target_compile_features("${Output}-SSE4" PRIVATE cxx_std_17) add_pcsx2_plugin("${Output}-AVX2" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags} -mavx -mavx2 -mbmi -mbmi2") + target_compile_features("${Output}-AVX2" PRIVATE cxx_std_17) else() add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}") endif() endif() +target_compile_features(${Output} PRIVATE cxx_std_17) + ################################### Replay Loader if(BUILD_REPLAY_LOADERS) set(Replay pcsx2_GSReplayLoader) @@ -275,4 +279,5 @@ if(BUILD_REPLAY_LOADERS) linux_replay.cpp ) add_pcsx2_executable(${Replay} "${GSdxReplayLoaderFinalSources}" "${LIBC_LIBRARIES}" "${GSdxFinalFlags}") + target_compile_features(${Replay} PRIVATE cxx_std_17) endif(BUILD_REPLAY_LOADERS) diff --git a/plugins/GSnull/CMakeLists.txt b/plugins/GSnull/CMakeLists.txt index 0cac20f014..34ed650e7b 100644 --- a/plugins/GSnull/CMakeLists.txt +++ b/plugins/GSnull/CMakeLists.txt @@ -75,3 +75,4 @@ set(GSnullFinalLibs ) add_pcsx2_plugin(${Output} "${GSnullFinalSources}" "${GSnullFinalLibs}" "${GSnullFinalFlags}") +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file diff --git a/plugins/LilyPad/CMakeLists.txt b/plugins/LilyPad/CMakeLists.txt index 88ec40844b..03338ed3ea 100644 --- a/plugins/LilyPad/CMakeLists.txt +++ b/plugins/LilyPad/CMakeLists.txt @@ -101,3 +101,4 @@ set(lilypadFinalSources ) add_pcsx2_plugin(${Output} "${lilypadFinalSources}" "${lilypadFinalLibs}" "${lilypadFinalFlags}") +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file diff --git a/plugins/PadNull/CMakeLists.txt b/plugins/PadNull/CMakeLists.txt index a8f958b30c..8199c5be4b 100644 --- a/plugins/PadNull/CMakeLists.txt +++ b/plugins/PadNull/CMakeLists.txt @@ -58,3 +58,4 @@ set(PadNullFinalLibs ) add_pcsx2_plugin(${Output} "${PadNullFinalSources}" "${PadNullFinalLibs}" "${PadNullFinalFlags}") +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file diff --git a/plugins/SPU2null/CMakeLists.txt b/plugins/SPU2null/CMakeLists.txt index 1690150713..57d16ea7cc 100644 --- a/plugins/SPU2null/CMakeLists.txt +++ b/plugins/SPU2null/CMakeLists.txt @@ -54,3 +54,4 @@ set(SPU2nullFinalLibs ) add_pcsx2_plugin(${Output} "${SPU2nullFinalSources}" "${SPU2nullFinalLibs}" "${SPU2nullFinalFlags}") +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file diff --git a/plugins/USBnull/CMakeLists.txt b/plugins/USBnull/CMakeLists.txt index b472c638da..f37d2cfc03 100644 --- a/plugins/USBnull/CMakeLists.txt +++ b/plugins/USBnull/CMakeLists.txt @@ -57,3 +57,5 @@ if(BUILTIN_USB) else() add_pcsx2_plugin(${Output} "${USBnullFinalSources}" "${USBnullFinalLibs}" "${USBnullFinalFlags}") endif() + +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file diff --git a/plugins/dev9ghzdrk/CMakeLists.txt b/plugins/dev9ghzdrk/CMakeLists.txt index 8c86558981..5cc1db3de6 100644 --- a/plugins/dev9ghzdrk/CMakeLists.txt +++ b/plugins/dev9ghzdrk/CMakeLists.txt @@ -113,6 +113,7 @@ set(dev9ghzdrkFinalLibs ) add_pcsx2_plugin(${Output} "${dev9ghzdrkFinalSources}" "${dev9ghzdrkFinalLibs}" "${dev9ghzdrkFinalFlags}") +target_compile_features(${Output} PRIVATE cxx_std_17) #if(PACKAGE_MODE) # install(FILES Linux/dev9ghzdrk.ui DESTINATION bin ) diff --git a/plugins/dev9null/CMakeLists.txt b/plugins/dev9null/CMakeLists.txt index 5f77929750..087e62cf88 100644 --- a/plugins/dev9null/CMakeLists.txt +++ b/plugins/dev9null/CMakeLists.txt @@ -55,3 +55,5 @@ if(BUILTIN_DEV9) else() add_pcsx2_plugin(${Output} "${dev9nullFinalSources}" "${dev9nullFinalLibs}" "${dev9nullFinalFlags}") endif() + +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file diff --git a/plugins/onepad/CMakeLists.txt b/plugins/onepad/CMakeLists.txt index 9a7fd02743..202a4d457a 100644 --- a/plugins/onepad/CMakeLists.txt +++ b/plugins/onepad/CMakeLists.txt @@ -143,3 +143,5 @@ if(BUILTIN_PAD) else() add_pcsx2_plugin(${Output} "${onepadFinalSources}" "${onepadFinalLibs}" "${onepadFinalFlags}") endif() + +target_compile_features(${Output} PRIVATE cxx_std_17) diff --git a/plugins/onepad_legacy/CMakeLists.txt b/plugins/onepad_legacy/CMakeLists.txt index ee289fcdaf..3f013407de 100644 --- a/plugins/onepad_legacy/CMakeLists.txt +++ b/plugins/onepad_legacy/CMakeLists.txt @@ -145,3 +145,5 @@ if(BUILTIN_PAD) else() add_pcsx2_plugin(${Output} "${onepadFinalSources}" "${onepadFinalLibs}" "${onepadFinalFlags}") endif() + +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file diff --git a/plugins/spu2-x/src/CMakeLists.txt b/plugins/spu2-x/src/CMakeLists.txt index f2df085696..547b5159f4 100644 --- a/plugins/spu2-x/src/CMakeLists.txt +++ b/plugins/spu2-x/src/CMakeLists.txt @@ -156,3 +156,5 @@ if(BUILTIN_SPU2) else() add_pcsx2_plugin(${Output} "${spu2xFinalSources}" "${spu2xFinalLibs}" "${spu2xFinalFlags}") endif() + +target_compile_features(${Output} PRIVATE cxx_std_17) \ No newline at end of file