Backporting Clang support to KDE 4.11 FindKDE4Internal.cmake
Alex Merry
kde at randomguy3.me.uk
Mon Aug 5 22:46:18 BST 2013
On 05/08/13 20:55, Milian Wolff wrote:
> I'm out of the loop, since this is so close to the final release I'm not sure
> whether I should get this in...
I'd say commit it; the patch is pretty trivial, and I can't see any way
it could break the build for anyone not using Clang, and build fixes are
generally acceptable at this point in the release cycle.
For those who can't be bothered digging out the diff, it is:
diff --git a/cmake/modules/FindKDE4Internal.cmake
b/cmake/modules/FindKDE4Internal.cmake
index 98a6f48..91867a0 100644
--- a/cmake/modules/FindKDE4Internal.cmake
+++ b/cmake/modules/FindKDE4Internal.cmake
@@ -1180,13 +1180,13 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang
_result)
ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+)
*\n *End of (search) list" )
ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
-if (CMAKE_COMPILER_IS_GNUCC)
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs)
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
-endif (CMAKE_COMPILER_IS_GNUCC)
+endif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang)
-if (CMAKE_COMPILER_IS_GNUCXX)
+if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs)
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
@@ -1301,7 +1301,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set (__KDE_HAVE_GCC_VISIBILITY 0)
endif (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT
_GCC_COMPILED_WITH_BAD_ALLOCATOR AND
-endif (CMAKE_COMPILER_IS_GNUCXX)
+endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
if (CMAKE_C_COMPILER MATCHES "icc")
More information about the kde-core-devel
mailing list