summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BuildTools/SCons/SConscript.boot1
-rw-r--r--Swiften/SConscript16
2 files changed, 16 insertions, 1 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index 2415fde..babd585 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -99,6 +99,7 @@ vars.Add(BoolVariable("experimental_ft", "Build experimental file transfer", "ye
99vars.Add(BoolVariable("experimental", "Build experimental features", "no")) 99vars.Add(BoolVariable("experimental", "Build experimental features", "no"))
100vars.Add(BoolVariable("set_iterator_debug_level", "Set _ITERATOR_DEBUG_LEVEL=0", "yes")) 100vars.Add(BoolVariable("set_iterator_debug_level", "Set _ITERATOR_DEBUG_LEVEL=0", "yes"))
101vars.Add(BoolVariable("unbound", "Build bundled ldns and unbound. Use them for DNS lookup.", "no")) 101vars.Add(BoolVariable("unbound", "Build bundled ldns and unbound. Use them for DNS lookup.", "no"))
102vars.Add(BoolVariable("check_headers", "Independently build compilation units for all Swiften headers for detecting missing dependencies.", "no"))
102 103
103vars.Add(BoolVariable("install_git_hooks", "Install git hooks", "true")) 104vars.Add(BoolVariable("install_git_hooks", "Install git hooks", "true"))
104 105
diff --git a/Swiften/SConscript b/Swiften/SConscript
index de71849..aff1478 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -1,4 +1,4 @@
1import os, re, Version, os.path, time 1import os, re, Version, os.path, time, urllib
2 2
3Import("env") 3Import("env")
4 4
@@ -541,6 +541,7 @@ if env["SCONS_STAGE"] == "build" :
541 return path[i+1:] 541 return path[i+1:]
542 swiften_header = "#pragma once\n" 542 swiften_header = "#pragma once\n"
543 swiften_includes = [] 543 swiften_includes = []
544 swiften_public_includes = []
544 top_path = env.Dir("..").abspath 545 top_path = env.Dir("..").abspath
545 for root, dirs, files in os.walk(env.Dir(".").abspath) : 546 for root, dirs, files in os.walk(env.Dir(".").abspath) :
546 if root.endswith("UnitTest") : 547 if root.endswith("UnitTest") :
@@ -568,6 +569,7 @@ if env["SCONS_STAGE"] == "build" :
568 if file == "Swiften.h" or file == "foreach.h" or file == "Log.h" or file == "format.h" : 569 if file == "Swiften.h" or file == "foreach.h" or file == "Log.h" or file == "format.h" :
569 continue 570 continue
570 swiften_header += "#include <" + include + ">\n" 571 swiften_header += "#include <" + include + ">\n"
572 swiften_public_includes.append(include)
571 swiften_includes.append(include) 573 swiften_includes.append(include)
572 swiften_env.WriteVal("Swiften.h", swiften_env.Value(swiften_header)) 574 swiften_env.WriteVal("Swiften.h", swiften_env.Value(swiften_header))
573 swiften_includes.append("Swiften/Swiften.h") 575 swiften_includes.append("Swiften/Swiften.h")
@@ -578,6 +580,18 @@ if env["SCONS_STAGE"] == "build" :
578 swiften_env.WriteVal("Version.h", swiften_env.Value(version_header)) 580 swiften_env.WriteVal("Version.h", swiften_env.Value(version_header))
579 swiften_includes.append("Swiften/Version.h") 581 swiften_includes.append("Swiften/Version.h")
580 582
583 # Check headers
584 if env["check_headers"] :
585 test_env = swiften_env.Clone()
586 for header in swiften_public_includes:
587 program_text = "#include <%s>\n" % (header)
588 filename = Dir('#/.sconf_temp').abspath + ("/%s.cpp" % (urllib.quote(header, '') ))
589 text_file = open(filename, "w")
590 text_file.write(program_text)
591 text_file.close()
592 test_obj = test_env.Object(File("#/.sconf_temp/%s.cpp" % (urllib.quote(header, '') )))
593 test_env.Default(test_obj)
594
581 # Install swiften 595 # Install swiften
582 if swiften_env.get("SWIFTEN_INSTALLDIR", "") : 596 if swiften_env.get("SWIFTEN_INSTALLDIR", "") :
583 swiften_env.Install(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "lib"), swiften_lib) 597 swiften_env.Install(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "lib"), swiften_lib)