Title: [205955] releases/WebKitGTK/webkit-2.14
Revision
205955
Author
carlo...@webkit.org
Date
2016-09-15 00:50:59 -0700 (Thu, 15 Sep 2016)

Log Message

Merge r205672 - [CMake] Build failure with GCC 6 (fatal error: stdlib.h: No such file or directory)
https://bugs.webkit.org/show_bug.cgi?id=161697

Reviewed by Michael Catanzaro.

Get the list of system includes from GCC and add it to the CMake
list of implicit includes. This way, CMake will filter any of this
directories from the list of includes when calling the compiler.

This avoids an issue with GCC 6 that causes build failures when
including the default include path as a system include (-isystem).

* Source/cmake/OptionsCommon.cmake:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/ChangeLog (205954 => 205955)


--- releases/WebKitGTK/webkit-2.14/ChangeLog	2016-09-15 07:40:20 UTC (rev 205954)
+++ releases/WebKitGTK/webkit-2.14/ChangeLog	2016-09-15 07:50:59 UTC (rev 205955)
@@ -1,3 +1,19 @@
+2016-09-08  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        [CMake] Build failure with GCC 6 (fatal error: stdlib.h: No such file or directory)
+        https://bugs.webkit.org/show_bug.cgi?id=161697
+
+        Reviewed by Michael Catanzaro.
+
+        Get the list of system includes from GCC and add it to the CMake
+        list of implicit includes. This way, CMake will filter any of this
+        directories from the list of includes when calling the compiler.
+
+        This avoids an issue with GCC 6 that causes build failures when
+        including the default include path as a system include (-isystem).
+
+        * Source/cmake/OptionsCommon.cmake:
+
 2016-09-09  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.91 release.

Modified: releases/WebKitGTK/webkit-2.14/Source/cmake/OptionsCommon.cmake (205954 => 205955)


--- releases/WebKitGTK/webkit-2.14/Source/cmake/OptionsCommon.cmake	2016-09-15 07:40:20 UTC (rev 205954)
+++ releases/WebKitGTK/webkit-2.14/Source/cmake/OptionsCommon.cmake	2016-09-15 07:50:59 UTC (rev 205955)
@@ -37,6 +37,33 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
 endif ()
 
+# Ensure that the default include system directories are added to the list of CMake implicit includes.
+# This workarounds an issue that happens when using GCC 6 and using system includes (-isystem).
+# For more details check: https://bugs.webkit.org/show_bug.cgi?id=161697
+macro(DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _compiler _flags _result)
+    file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n")
+    separate_arguments(_buildFlags UNIX_COMMAND "${_flags}")
+    execute_process(COMMAND ${_compiler} ${_buildFlags} -v -E -x ${_lang} -dD dummy
+                    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles OUTPUT_QUIET
+                    ERROR_VARIABLE _gccOutput)
+    file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
+    if ("${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list")
+        set(${_result} ${CMAKE_MATCH_1})
+        string(REPLACE "\n" " " ${_result} "${${_result}}")
+        separate_arguments(${_result})
+    endif ()
+endmacro()
+
+if (CMAKE_COMPILER_IS_GNUCC)
+   DETERMINE_GCC_SYSTEM_INCLUDE_DIRS("c" "${CMAKE_C_COMPILER}" "${CMAKE_C_FLAGS}" SYSTEM_INCLUDE_DIRS)
+   set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ${SYSTEM_INCLUDE_DIRS})
+endif ()
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+   DETERMINE_GCC_SYSTEM_INCLUDE_DIRS("c++" "${CMAKE_CXX_COMPILER}" "${CMAKE_CXX_FLAGS}" SYSTEM_INCLUDE_DIRS)
+   set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${SYSTEM_INCLUDE_DIRS})
+endif ()
+
 # Detect Cortex-A53 core if CPU is ARM64 and OS is Linux.
 # Query /proc/cpuinfo for each available core and check reported CPU part number: 0xd03 signals Cortex-A53.
 # (see Main ID Register in ARM Cortex-A53 MPCore Processor Technical Reference Manual)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to