Add contact panel
diff --git a/wscript b/wscript
index 3e754e5..e60e569 100644
--- a/wscript
+++ b/wscript
@@ -2,13 +2,15 @@
VERSION='0.1'
APPNAME='QT-Test'
+from waflib import Configure
+
def options(opt):
opt.load('compiler_c compiler_cxx boost protoc qt4')
def configure(conf):
conf.load("compiler_c compiler_cxx")
-# conf.add_supported_cxxflags (cxxflags = ['-O3', '-g'])
+ conf.add_supported_cxxflags (cxxflags = ['-O3', '-g'])
conf.load('protoc')
@@ -17,3 +19,42 @@
conf.load('boost')
conf.check_boost(lib='system random thread')
+
+ conf.write_config_header('config.h')
+
+
+def build (bld):
+ qt = bld (
+ target = "ChronoChat",
+ features = "qt4 cxx cxxprogram",
+ defines = "WAF",
+ source = bld.path.ant_glob(['src/*.cpp', 'src/*.ui']),
+ includes = ".",
+ use = "QTCORE QTGUI",
+ )
+
+
+@Configure.conf
+def add_supported_cxxflags(self, cxxflags):
+ """
+ Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
+ """
+ self.start_msg('Checking allowed flags for c++ compiler')
+
+ supportedFlags = []
+ for flag in cxxflags:
+ if self.check_cxx (cxxflags=[flag], mandatory=False):
+ supportedFlags += [flag]
+
+ self.end_msg (' '.join (supportedFlags))
+ self.env.CXXFLAGS += supportedFlags
+
+from waflib.TaskGen import feature, before_method, after_method
+@feature('cxx')
+@after_method('process_source')
+@before_method('apply_incpaths')
+def add_includes_paths(self):
+ incs = set(self.to_list(getattr(self, 'includes', '')))
+ for x in self.compiled_tasks:
+ incs.add(x.inputs[0].parent.path_from(self.path))
+ self.includes = list(incs)