mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 09:57:15 +01:00
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
|
#! /usr/bin/env python
|
||
|
# encoding: utf-8
|
||
|
# Thomas Nagy, 2016 (ita)
|
||
|
|
||
|
VERSION='0.0.1'
|
||
|
APPNAME='qt5_test'
|
||
|
|
||
|
top = '.'
|
||
|
out = 'build'
|
||
|
|
||
|
def options(opt):
|
||
|
opt.load('compiler_cxx qt5')
|
||
|
|
||
|
def configure(conf):
|
||
|
conf.load('compiler_cxx qt5')
|
||
|
#conf.env.append_value('CXXFLAGS', ['-g']) # test
|
||
|
|
||
|
# Qt5 may be compiled with '-reduce-relocations' which requires dependent programs to have -fPIE or -fPIC?
|
||
|
frag = '#include <QApplication>\nint main(int argc, char **argv) {return 0;}\n'
|
||
|
uses = 'QT5CORE QT5WIDGETS QT5GUI'
|
||
|
try:
|
||
|
conf.check(features='qt5 cxx', use=uses, fragment=frag, msg='See if Qt files compile directly')
|
||
|
except conf.errors.ConfigurationError:
|
||
|
conf.check(features='qt5 cxx', use=uses, fragment=frag, uselib_store='qt5', cxxflags='-fPIE',
|
||
|
msg='Try again with -fPIE', okmsg='-fPIE seems to be required')
|
||
|
|
||
|
def build(bld):
|
||
|
bld(
|
||
|
features = 'qt5 cxx cxxprogram',
|
||
|
use = 'QT5CORE QT5GUI QT5SVG QT5WIDGETS',
|
||
|
source = 'main.cpp res.qrc but.ui foo.cpp',
|
||
|
target = 'window',
|
||
|
includes = '.',
|
||
|
defines = 'WAF=1', # test
|
||
|
lang = bld.path.ant_glob('linguist/*.ts'),
|
||
|
langname = 'somefile', # include the .qm files from somefile.qrc
|
||
|
)
|
||
|
|