<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[165975] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/165975">165975</a></dd>
<dt>Author</dt> <dd>zandobersek@gmail.com</dd>
<dt>Date</dt> <dd>2014-03-20 11:22:54 -0700 (Thu, 20 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK][CMake] Add support for building with Clang
https://bugs.webkit.org/show_bug.cgi?id=130260

Reviewed by Martin Robinson.

.: 

* Source/PlatformGTK.cmake: Run the generate-gtkdoc script with the CFLAGS env set
to the list C compiler flags as constructed by CMake.
* Source/cmake/OptionsCommon.cmake: When building with Clang, use the -Qunused-arguments
compiler option to suppress verbose warnings about arguments that went unused by the driver.
* Source/cmake/OptionsGTK.cmake: Use -fno-omit-frame-pointer for both GCC and Clang.
-fno-tree-dce should be used only for GCC.
* Source/cmake/gtest/CMakeLists.txt: When building with Clang the GTest framework
should be built with GTEST_HAS_TR1_TUPLE macro defined to 0 to avoid build failures.

Tools: 

* TestWebKitAPI/CMakeLists.txt: When building with Clang TestWebKitAPI should be
built with GTEST_HAS_TR1_TUPLE defined to 0 to avoid build failures occuring in the
included GTest framework headers.
* gtk/generate-gtkdoc:
(prepare_environment_for_gtkdoc_generation): Don't modify the CFLAGS env anymore
in case of using Clang since that is now set by the CMake rule.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkSourcePlatformGTKcmake">trunk/Source/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourcecmakeOptionsCommoncmake">trunk/Source/cmake/OptionsCommon.cmake</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
<li><a href="#trunkSourcecmakegtestCMakeListstxt">trunk/Source/cmake/gtest/CMakeLists.txt</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPICMakeListstxt">trunk/Tools/TestWebKitAPI/CMakeLists.txt</a></li>
<li><a href="#trunkToolsgtkgenerategtkdoc">trunk/Tools/gtk/generate-gtkdoc</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/ChangeLog        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-03-20  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
+        [GTK][CMake] Add support for building with Clang
+        https://bugs.webkit.org/show_bug.cgi?id=130260
+
+        Reviewed by Martin Robinson.
+
+        * Source/PlatformGTK.cmake: Run the generate-gtkdoc script with the CFLAGS env set
+        to the list C compiler flags as constructed by CMake.
+        * Source/cmake/OptionsCommon.cmake: When building with Clang, use the -Qunused-arguments
+        compiler option to suppress verbose warnings about arguments that went unused by the driver.
+        * Source/cmake/OptionsGTK.cmake: Use -fno-omit-frame-pointer for both GCC and Clang.
+        -fno-tree-dce should be used only for GCC.
+        * Source/cmake/gtest/CMakeLists.txt: When building with Clang the GTest framework
+        should be built with GTEST_HAS_TR1_TUPLE macro defined to 0 to avoid build failures.
+
</ins><span class="cx"> 2014-03-20  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r165962.
</span></span></pre></div>
<a id="trunkSourcePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/PlatformGTK.cmake (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/PlatformGTK.cmake        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/Source/PlatformGTK.cmake        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">     add_custom_command(
</span><span class="cx">         OUTPUT &quot;${CMAKE_BINARY_DIR}/${_stamp_name}&quot;
</span><span class="cx">         DEPENDS ${DocumentationDependencies}
</span><del>-        COMMAND CC=&quot;${CMAKE_C_COMPILER}&quot; ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
</del><ins>+        COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
</ins><span class="cx">         COMMAND touch ${_stamp_name}
</span><span class="cx">         WORKING_DIRECTORY &quot;${CMAKE_BINARY_DIR}&quot;
</span><span class="cx">     )
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsCommoncmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsCommon.cmake (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsCommon.cmake        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/Source/cmake/OptionsCommon.cmake        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -34,6 +34,11 @@
</span><span class="cx"> 
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span><ins>+if (&quot;${CMAKE_CXX_COMPILER_ID}&quot; STREQUAL &quot;Clang&quot;)
+    set(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -Qunused-arguments&quot;)
+    set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -Qunused-arguments&quot;)
+endif ()
+
</ins><span class="cx"> string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR)
</span><span class="cx"> if (&quot;${CMAKE_CXX_COMPILER_ID}&quot; STREQUAL &quot;GNU&quot; AND &quot;${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}&quot; MATCHES &quot;(i[3-6]86|x86)&quot;)
</span><span class="cx">     # To avoid out of memory when building with debug option in 32bit system.
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/Source/cmake/OptionsGTK.cmake        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -293,9 +293,15 @@
</span><span class="cx"> set(SHOULD_INSTALL_JS_SHELL ON)
</span><span class="cx"> 
</span><span class="cx"> # Push of rbp is needed after JSC JIT uses CStack. See http://wkbug.com/127777.
</span><del>-if (CMAKE_COMPILER_IS_GNUCC AND UNIX AND NOT APPLE)
-    set(CMAKE_C_FLAGS_RELEASE &quot;-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_C_FLAGS_RELEASE}&quot;)
-    set(CMAKE_CXX_FLAGS_RELEASE &quot;-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_CXX_FLAGS_RELEASE}&quot;)
</del><ins>+if (UNIX AND NOT APPLE)
+    if (CMAKE_COMPILER_IS_GNUCXX)
+        set(CMAKE_C_FLAGS_RELEASE &quot;-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_C_FLAGS_RELEASE}&quot;)
+        set(CMAKE_CXX_FLAGS_RELEASE &quot;-fno-omit-frame-pointer -fno-tree-dce ${CMAKE_CXX_FLAGS_RELEASE}&quot;)
+    endif ()
+    if (${CMAKE_CXX_COMPILER_ID} STREQUAL &quot;Clang&quot;)
+        set(CMAKE_C_FLAGS_RELEASE &quot;-fno-omit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}&quot;)
+        set(CMAKE_CXX_FLAGS_RELEASE &quot;-fno-omit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}&quot;)
+    endif ()
</ins><span class="cx"> endif ()
</span><span class="cx"> 
</span><span class="cx"> # Add a typelib file to the list of all typelib dependencies. This makes it easy to
</span></span></pre></div>
<a id="trunkSourcecmakegtestCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/gtest/CMakeLists.txt (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/gtest/CMakeLists.txt        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/Source/cmake/gtest/CMakeLists.txt        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -24,6 +24,13 @@
</span><span class="cx"> 
</span><span class="cx"> add_definitions(-DGTEST_CREATE_SHARED_LIBRARY=1 -DGTEST_HAS_RTTI=0)
</span><span class="cx"> 
</span><ins>+# FIXME: This works around compatibility problems in the old version of the third-pary
+# googletest source code checkout. It should be removed once we upgrade to a newer version.
+if (&quot;${CMAKE_CXX_COMPILER_ID}&quot; STREQUAL &quot;Clang&quot;)
+    add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
+endif ()
+
+
</ins><span class="cx"> target_link_libraries(gtest
</span><span class="cx">     WTF
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/Tools/ChangeLog        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-03-20  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
+        [GTK][CMake] Add support for building with Clang
+        https://bugs.webkit.org/show_bug.cgi?id=130260
+
+        Reviewed by Martin Robinson.
+
+        * TestWebKitAPI/CMakeLists.txt: When building with Clang TestWebKitAPI should be
+        built with GTEST_HAS_TR1_TUPLE defined to 0 to avoid build failures occuring in the
+        included GTest framework headers.
+        * gtk/generate-gtkdoc:
+        (prepare_environment_for_gtkdoc_generation): Don't modify the CFLAGS env anymore
+        in case of using Clang since that is now set by the CMake rule.
+
</ins><span class="cx"> 2014-03-19  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Expose text and page zoom in WK2 SPI, and hook them up in MiniBrowser
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPICMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/CMakeLists.txt (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/CMakeLists.txt        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/Tools/TestWebKitAPI/CMakeLists.txt        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -91,6 +91,12 @@
</span><span class="cx">     -DTEST_INJECTED_BUNDLE_PATH=\&quot;${TestWebKitAPIInjectedBundle_PATH}\&quot;
</span><span class="cx"> )
</span><span class="cx"> 
</span><ins>+# FIXME: This works around compatibility problems in the old version of the third-pary
+# googletest source code checkout. It should be removed once we upgrade to a newer version.
+if (&quot;${CMAKE_CXX_COMPILER_ID}&quot; STREQUAL &quot;Clang&quot;)
+    add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
+endif ()
+
</ins><span class="cx"> add_executable(TestWTF
</span><span class="cx">     ${test_main_SOURCES}
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/TestsController.cpp
</span></span></pre></div>
<a id="trunkToolsgtkgenerategtkdoc"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/generate-gtkdoc (165974 => 165975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/generate-gtkdoc        2014-03-20 18:18:32 UTC (rev 165974)
+++ trunk/Tools/gtk/generate-gtkdoc        2014-03-20 18:22:54 UTC (rev 165975)
</span><span class="lines">@@ -169,10 +169,6 @@
</span><span class="cx">     cflags += ' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'
</span><span class="cx">     os.environ['CFLAGS'] = cflags
</span><span class="cx"> 
</span><del>-    # Clang can be noisy, throwing unnecessary warnings for unused arguments.
-    if os.environ.get('CC') == &quot;clang&quot;:
-        os.environ['CFLAGS'] += ' -Qunused-arguments'
-
</del><span class="cx">     # Paths from the GNUmakefile generated configuration files are relative to the build directory.
</span><span class="cx">     os.chdir(common.build_path())
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>