summaryrefslogtreecommitdiff
path: root/src/SConscript
diff options
context:
space:
mode:
authorThomas Tanner <trtanner@btinternet.com>2015-10-17 19:05:00 +0100
committerThomas Tanner <trtanner@btinternet.com>2015-10-17 19:05:00 +0100
commit0f8ae514592c46dc8465bc5830d7a830b68affe2 (patch)
treea91d30571a7c00f0e467addc27e3b4f18e9c99af /src/SConscript
parentdfdf80417e6b4a6b1a353810ba473aa70e0c9abd (diff)
Added support for include-what-you-use in a very simplistic fashion to the Scons build. This isn't exactly production ready because the qt headers are a nightmarish web of interdependencies but it's useful for checking.
I've also removed a few unused include files it detected and corrected some things that upset clang in a big way.
Diffstat (limited to 'src/SConscript')
-rw-r--r--src/SConscript14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/SConscript b/src/SConscript
index f09db093..cd2d8a52 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -67,7 +67,6 @@ env.Uic(env.Glob('*.ui'))
env.RequireLibraries('uibase', 'shared', 'bsatk', 'esptk')
-
env.AppendUnique(LIBS = [
'shell32',
'user32',
@@ -114,8 +113,9 @@ env.AppendUnique(LINKFLAGS = [
# modeltest is optional and it doesn't compile anyway...
cpp_files = [
- x for x in Glob('*.cpp')
- if x.name != 'modeltest.cpp' and x.name != 'aboutdialog.cpp'
+ x for x in env.Glob('*.cpp', source = True)
+ if x.name != 'modeltest.cpp' and x.name != 'aboutdialog.cpp' and \
+ not x.name.startswith('moc_') # I think this is a strange bug
]
about_env = env.Clone()
@@ -143,6 +143,14 @@ env.AppendUnique(LIBS = 'zlibstatic')
prog = env.Program('ModOrganizer',
cpp_files + env.Glob('*.qrc') + other_sources)
+###############################################################################
+# I'd like to automatically add this to every .o generation.
+if 'IWYU' in env:
+ for f in cpp_files + [ env.File('aboutdialog.cpp') ]:
+ env.AddPostAction(prog, "-$IWYU $IWYU_FLAGS -Xiwyu --mapping_file=$IWYU_MAPPING_FILE $IWYU_COMCOM " + str(f))
+ env.Depends(prog, env['IWYU_MAPPING_FILE'])
+###############################################################################
+
env.InstallModule(prog)
for subdir in ('tutorials', 'stylesheets'):