gtkdoc-scangobj throwing warnings when using Clang, causes generate-gtkdoc to fail
https://bugs.webkit.org/show_bug.cgi?id=109315
Patch by Zan Dobersek <zdobersek@igalia.com> on 2013-02-10
Reviewed by Philippe Normand.
* GNUmakefile.am: Define the CC environment variable to the CC compiler that the whole
project was configured to use. This ensures both the regular build and the gtkdoc-scangobj
program use the same compiler.
* gtk/generate-gtkdoc: Add '-Qunused-arguments' to the CFLAGS in case we're using Clang. This
forces Clang to suppress unused arguments warnings that can unnecessarily cause generate-gtkdoc
script to fail.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 5ca90bb..cf1292a 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,17 @@
+2013-02-10 Zan Dobersek <zdobersek@igalia.com>
+
+ gtkdoc-scangobj throwing warnings when using Clang, causes generate-gtkdoc to fail
+ https://bugs.webkit.org/show_bug.cgi?id=109315
+
+ Reviewed by Philippe Normand.
+
+ * GNUmakefile.am: Define the CC environment variable to the CC compiler that the whole
+ project was configured to use. This ensures both the regular build and the gtkdoc-scangobj
+ program use the same compiler.
+ * gtk/generate-gtkdoc: Add '-Qunused-arguments' to the CFLAGS in case we're using Clang. This
+ forces Clang to suppress unused arguments warnings that can unnecessarily cause generate-gtkdoc
+ script to fail.
+
2013-02-09 David Farler <dfarler@apple.com>
Make TestWebKitAPI work for iOS
diff --git a/Tools/GNUmakefile.am b/Tools/GNUmakefile.am
index 3c87193..63bcfb2 100644
--- a/Tools/GNUmakefile.am
+++ b/Tools/GNUmakefile.am
@@ -321,7 +321,7 @@
libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
- $(srcdir)/Tools/gtk/generate-gtkdoc
+ CC=$(CC) $(srcdir)/Tools/gtk/generate-gtkdoc
@touch docs-build.stamp
else
docs-build.stamp: \
@@ -329,7 +329,7 @@
Source/WebKit/gtk/docs/webkitenvironment.xml \
Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
Source/WebKit/gtk/docs/webkitgtk-sections.txt
- $(srcdir)/Tools/gtk/generate-gtkdoc
+ CC=$(CC) $(srcdir)/Tools/gtk/generate-gtkdoc
@touch docs-build.stamp
endif
diff --git a/Tools/gtk/generate-gtkdoc b/Tools/gtk/generate-gtkdoc
index b0cab31..a1d5109 100755
--- a/Tools/gtk/generate-gtkdoc
+++ b/Tools/gtk/generate-gtkdoc
@@ -172,6 +172,10 @@
cflags += ' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'
os.environ['CFLAGS'] = cflags
+# Clang can be noisy, throwing unnecessary warnings for unused arguments.
+if os.environ.get('CC') == "clang":
+ os.environ['CFLAGS'] += ' -Qunused-arguments'
+
saw_webkit1_warnings = saw_webkit2_warnings = False
pkg_config_path = common.build_path('Source', 'WebKit', 'gtk', 'webkitgtk-3.0.pc')