From 3f66d206e82accd986a82850218d20970b7c0cfa Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Sat, 14 Mar 2015 14:59:52 +0000 Subject: [PATCH] More sconscripts set up --- src/runner/SConscript | 69 +++++++++++++++++++++++++++++++++++++ src/runner/pythonRunner.pro | 3 ++ 2 files changed, 72 insertions(+) create mode 100644 src/runner/SConscript diff --git a/src/runner/SConscript b/src/runner/SConscript new file mode 100644 index 0000000..ead0395 --- /dev/null +++ b/src/runner/SConscript @@ -0,0 +1,69 @@ +import os + +Import('qt_env') + +env = qt_env.Clone() + +modules = [ + 'Core', + 'Gui', +] + +env.EnableQt4Modules(['Qt' + n for n in modules], + debug = env['CONFIG'] == 'debug') + +env.AppendUnique(CPPDEFINES = 'PYTHONRUNNER_LIBRARY') + +# suppress a few warnings caused by boost vs vc++ paranoia +# NB HAVE_ROUND causes a warning because it's defined in pythonrunner.cpp +env.AppendUnique(CPPDEFINES = [ + '_SCL_SECURE_NO_WARNINGS', + 'HAVE_ROUND' +]) + +#CONFIG(debug, debug|release) { +# LIBS += -L$$OUT_PWD/../uibase/debug +#} else { +# LIBS += -L$$OUT_PWD/../uibase/release +# QMAKE_CXXFLAGS += /Zi +# QMAKE_LFLAGS += /DEBUG +#} +# + +# AppendUnique appears not to work with QT4 +env['CPPPATH'] += [ + '${BOOST_PATH}', + '${PYTHONPATH}\\include', + '..\\uibase' +] + +env.AppendUnique(LIBS = [ + 'python27', # Could be done better + 'uibase' +]) + +env.AppendUnique(LIBPATH = [ + '${PYTHONPATH}/libs', # Could be done better + '..\\uibase' +]) + +# We have to 'persuade' moc to generate certain other targets and inject them +# into the list of cpps +targets = env.AddExtraMoc(env.Glob('*.h')) + +# pythontoolwrapper doesnt compile and isn't in the project file +cpp_files = [ x for x in Glob('*.cpp') + if not str(x).endswith('pythontoolwrapper.cpp') ] + +lib = env.SharedLibrary('pythonrunner', cpp_files + targets) +env.Depends(lib, env.Value(env['ENV']['DLLSPATH'])) + +# FIXME scons bug doesn't provide pdb for executable. +if env['CONFIG'] == 'debug': + x = env.File('pythonrunner.pdb') + env.Depends(x, lib) + lib.append(x) + +env.Install(env['INSTALL_PATH'], [ + filter(lambda x: str(x).endswith('.dll') or str(x).endswith('.pdb'), lib), +]) diff --git a/src/runner/pythonRunner.pro b/src/runner/pythonRunner.pro index e6e7d71..c159145 100644 --- a/src/runner/pythonRunner.pro +++ b/src/runner/pythonRunner.pro @@ -59,3 +59,6 @@ SRCDIR ~= s,/,$$QMAKE_DIR_SEP,g DSTDIR ~= s,/,$$QMAKE_DIR_SEP,g QMAKE_POST_LINK += xcopy /y /I $$quote($$SRCDIR\\$${TARGET}*.pdb) $$quote($$DSTDIR)\\plugins $$escape_expand(\\n) + +OTHER_FILES += \ + SConscript