Can build Qt5 applications.

pull/15/head
Jussi Pakkanen 12 years ago
parent e3184c4f94
commit 35f3495c1d
  1. 3
      backends.py
  2. 8
      dependencies.py
  3. 3
      interpreter.py
  4. 9
      test cases/frameworks/4 qt5/main.cpp

@ -183,6 +183,9 @@ class Backend():
commands += compiler.get_pic_flags()
for dep in target.get_external_deps():
commands += dep.get_compile_flags()
if isinstance(target, interpreter.Executable):
commands += dep.get_exe_flags()
return commands
def build_target_link_arguments(self, deps):

@ -62,6 +62,9 @@ class Dependency():
def get_generate_rules(self):
return []
def get_exe_flags(self):
return []
class PkgConfigDependency(Dependency):
pkgconfig_found = False
@ -356,6 +359,11 @@ class Qt5Dependency(Dependency):
'Compiling @INFILE@ with the ui compiler')
return [moc_rule, ui_rule]
def get_exe_flags(self):
# Qt5 seems to require this always.
# Fix this to be more portable, especially to MSVC.
return ['-fPIE']
def get_dep_identifier(name, kwargs):
elements = [name]

@ -84,6 +84,9 @@ class ExternalLibraryHolder(InterpreterObject):
def get_link_flags(self):
return self.el.get_link_flags()
def get_exe_flags(self):
return self.el.get_exe_flags()
class Generator(InterpreterObject):

@ -4,8 +4,11 @@
int main(int argc, char **argv) {
QApplication app(argc, argv);
MainWindow *win = new MainWindow();
win->setWindowTitle("Button demo app");
win->show();
win->setWindowTitle("Meson Qt5 build test");
return app.exec();
// Don't actually start the GUI so this
// can be run as a unit test.
//win->show();
//return app.exec();
return 0;
}

Loading…
Cancel
Save