diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-05-22 22:55:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-22 22:55:04 +0200 |
commit | 6821a45b7fb59c5523373a3c8fc98fdaa41fdc29 (patch) | |
tree | 6c2682433f7e2bd2255104a625372d4c6d112791 | |
parent | f24cdd6564c0abf39b10b31d3896b939b4dbd7d3 (diff) | |
parent | 0b85051a2363f4fad29477e3a0ccd3fda18fee01 (diff) | |
download | PrismLauncher-6821a45b7fb59c5523373a3c8fc98fdaa41fdc29.tar.gz PrismLauncher-6821a45b7fb59c5523373a3c8fc98fdaa41fdc29.tar.bz2 PrismLauncher-6821a45b7fb59c5523373a3c8fc98fdaa41fdc29.zip |
Merge pull request #620 from Scrumplex/update-cxxflags
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e6d66b8d..a8c28e99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,21 +34,20 @@ set(CMAKE_C_STANDARD_REQUIRED true) set(CMAKE_CXX_STANDARD 11) set(CMAKE_C_STANDARD 11) include(GenerateExportHeader) -set(CMAKE_CXX_FLAGS " -Wall -pedantic -Werror -Wno-deprecated-declarations -D_GLIBCXX_USE_CXX11_ABI=0 -fstack-protector-strong --param=ssp-buffer-size=4 -O3 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS "-Wall -pedantic -Werror -Wno-deprecated-declarations -D_GLIBCXX_USE_CXX11_ABI=0 -fstack-protector-strong --param=ssp-buffer-size=4 ${CMAKE_CXX_FLAGS}") if(UNIX AND APPLE) - set(CMAKE_CXX_FLAGS " -stdlib=libc++ ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}") endif() -# FIXME: GCC 12 complains about some random stuff in QuaZip. Need to fix this later -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "-Wno-error=stringop-overflow ${CMAKE_CXX_FLAGS}") -endif() -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type") # Fix build with Qt 5.13 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_DISABLE_DEPRECATED_BEFORE=0x050C00") +# set CXXFLAGS for build targets +set(CMAKE_CXX_FLAGS_DEBUG "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS}") + option(ENABLE_LTO "Enable Link Time Optimization" off) if(ENABLE_LTO) |