aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Becker <heiko.becker@kde.org>2021-12-15 23:02:56 +0100
committerHeiko Becker <heiko.becker@kde.org>2021-12-16 14:13:59 +0100
commitaf1555f79dd7d9023c613dc120c4f034a827d0a0 (patch)
tree6e17798b8fbaa787464a8a74e6e12e5d43998751
parentc4acfc90a3fce0bbf44c998d03f2b3bc65a90052 (diff)
Don't hard code std=c++14 in CXX_FLAGS
I got the following build error "src/checks/level2/missing-qobject-macro.cpp:93:43: error: 'std::filesystem' has not been declared". I'm pretty sure that my compiler (gcc 11.2.0) supports it and cmake seems to agree and defines -DHAS_STD_FILESYSTEM. It turns out that the manual addition of "-std=c++14" to CMAKE_CXX_FLAGS overwrote "CMAKE_CXX_STANDARD 17" here. Seems generally nicer to only have that in one place and it also fixes the previously mentioned build error.
-rw-r--r--CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 22706c13..c6a40ae5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,7 +61,7 @@ if(MSVC)
# disable trigger-happy warnings from Clang/LLVM headers
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244 /wd4291 /wd4800 /wd4141 /wd4146 /wd4251")
elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti")
endif()
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")