blob: 878688b89c0c0090f493e8b93aed8dbb6e385450 [file] [log] [blame]
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
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.load('protoc')
conf.load('qt4')
conf.load('boost')
conf.check_boost(lib='system random thread')
conf.write_config_header('config.h')
def build (bld):
qt = bld (
target = "Contacts",
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)