summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-05-01 19:23:58 +0200
committerPhilip Withnall <philip.withnall@collabora.co.uk>2014-05-01 19:23:58 +0200
commit49c06c8753bbaa9d8f8cd9083bd6e3fe56a75688 (patch)
treefc8bdc70bc795e7866baad520f8db7d21691bb0f
parenteb134f63352ef984b9568521e0979aa1e6bc54f5 (diff)
website: Add a note about system include paths
I think Clang should include these automatically, but apparently it doesn’t. This is one good reason why it’s suggested to use gnome-clang via JHBuild in the normal build process, rather than running it separately.
-rw-r--r--website/index.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/website/index.html b/website/index.html
index 2de7556..ae08f45 100644
--- a/website/index.html
+++ b/website/index.html
@@ -127,11 +127,17 @@ of the gnome-clang invocation may change in future:</p>
<p>The easiest way to use gnome-clang with the Clang static analyser directly is
to use the <span class="program-name">gnome-clang</span> wrapper script,
e.g.:<br/>
-<span class="command">clang -cc1 -analyze -std=c89 my-project/*.c</span><br/>
+<span class="command">clang -cc1 -analyze -std=c89 $system_includes my-project/*.c</span><br/>
becomes:<br/>
-<span class="command">gnome-clang -cc1 -analyze -std=c89 my-project/*.c</span><br/>
+<span class="command">gnome-clang -cc1 -analyze -std=c89 $system_includes my-project/*.c</span><br/>
which wraps the normal Clang compiler and automatically loads the correct
-plugin.</p>
+plugin. The system includes should be set using:<br />
+<span class="command">system_includes=`echo | cpp -Wp,-v 2>&amp;1 |
+grep '^[[:space:]]' | sed -e 's/^[[:space:]]*/-isystem/' |
+tr "\n" ' '`</span><br />
+You should also specify your project’s include flags, for example using
+<span class="command">pkg-config</span>:<br />
+<span class="command">gnome-clang -cc1 -analyze -std=c89 $system_includes `pkg-config --cflags glib-2.0` my-project/*.c</span></p>
<p>The <span class="program-name">gnome-clang</span> script looks for the
<span class="program-name">clang</span> binary in the same directory as itself,