Changeset View
Changeset View
Standalone View
Standalone View
kde-modules/KDEFrameworkCompilerSettings.cmake
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | |||||
66 | endif() | 66 | endif() | ||
67 | 67 | | |||
68 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | 68 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
69 | if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0") | 69 | if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0") | ||
70 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant" ) | 70 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant" ) | ||
71 | endif() | 71 | endif() | ||
72 | endif() | 72 | endif() | ||
73 | 73 | | |||
74 | if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | 74 | # don't enable with apple clang | ||
75 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||||
rjvbb: I'm amazed that this works because CMake *may* detect Apple's clang as AppleClang depending on… | |||||
75 | if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0") | 76 | if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0") | ||
76 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant" ) | 77 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant" ) | ||
77 | endif() | 78 | endif() | ||
78 | endif() | 79 | endif() |
I'm amazed that this works because CMake *may* detect Apple's clang as AppleClang depending on version and how policy 25 (IIRC) is set. Annoyingly that policy can only be set before the toplevel project statement, i.e. not in the ECM.
In addition, Apple's versioning is very hard if not impossible to match with upstream versioning.