diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-08-13 15:46:26 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-08-13 15:53:51 (GMT) |
commit | d51d1a462876ee547f618eabc21674276e2f3db3 (patch) | |
tree | ac6b739f8f2147139742fae54d9dd9345a6c8bc7 | |
parent | 20136e351257a4cc4c033d8e0ef0212984389999 (diff) | |
download | swift-contrib-d51d1a462876ee547f618eabc21674276e2f3db3.zip swift-contrib-d51d1a462876ee547f618eabc21674276e2f3db3.tar.bz2 |
Fix Windows bundling.
-rw-r--r-- | BuildTools/SCons/Tools/WindowsBundle.py | 15 | ||||
-rw-r--r-- | SConstruct | 2 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 24 |
3 files changed, 22 insertions, 19 deletions
diff --git a/BuildTools/SCons/Tools/WindowsBundle.py b/BuildTools/SCons/Tools/WindowsBundle.py new file mode 100644 index 0000000..1cada9d --- /dev/null +++ b/BuildTools/SCons/Tools/WindowsBundle.py @@ -0,0 +1,15 @@ +import SCons.Util, os + +def generate(env) : + def createWindowsBundle(env, bundle, resources = [], qtlibs = []) : + env.Install(bundle, bundle + ".exe") + for lib in qtlibs : + env.Install(bundle, os.path.join(env["QTDIR"], "bin", lib + ".dll")) + for resource in resources : + env.Install(bundle, resource) + + env.AddMethod(createWindowsBundle, "WindowsBundle") + +def exists(env) : + return env["PLATFORM"] == "win32" + @@ -34,6 +34,8 @@ env.Alias("dist", ["."]) if env["PLATFORM"] == "darwin" : env.Tool("Nib", toolpath = ["#/BuildTools/SCons/Tools"]) env.Tool("AppBundle", toolpath = ["#/BuildTools/SCons/Tools"]) +if env["PLATFORM"] == "win32" : + env.Tool("WindowsBundle", toolpath = ["#/BuildTools/SCons/Tools"]) # Default compiler flags if env["optimize"] : diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 1666c64..8f9e2a0 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -15,17 +15,9 @@ def generateDefaultTheme(env, target, source) : output.write("</qresource>") output.write("</RCC>") -def buildWindowsBundle(env, target, source) : - sources = source - if not os.path.exists(target[0].abspath) : - os.mkdir(target[0].abspath) - for source in sources : - shutil.copy(source.abspath, target[0].abspath) - Import("env") myenv = env.Clone() -myenv["BUILDERS"]["WindowsBundle"] = Builder(action = Action(buildWindowsBundle, cmdstr = "$BUNDLECOMSTR")) myenv.MergeFlags(env["SWIFT_CONTROLLERS_FLAGS"]) myenv.MergeFlags(env["SWIFTEN_FLAGS"]) @@ -98,18 +90,12 @@ if env["PLATFORM"] == "darwin" : ]) if env["PLATFORM"] == "win32" : - if "dist" in COMMAND_LINE_TARGETS or env.GetOption("clean") : - myenv.WindowsBundle(Dir("Swift"), [ - swiftProgram[0], - File(os.path.join(env["QTDIR"], "bin", "QtCore4.dll")), - File(os.path.join(env["QTDIR"], "bin", "QtGui4.dll")), - File(os.path.join(env["QTDIR"], "bin", "QtNetwork4.dll")), - File(os.path.join(env["QTDIR"], "bin", "QtWebKit4.dll")), - File(os.path.join(env["QTDIR"], "bin", "phonon4.dll")), - File(os.path.join(env["OPENSSL_DIR"], "bin", "ssleay32.dll")), - File(os.path.join(env["OPENSSL_DIR"], "bin", "libeay32.dll")), - ]) + myenv.WindowsBundle("Swift", resources = [ + os.path.join(env["OPENSSL_DIR"], "bin", "ssleay32.dll"), + os.path.join(env["OPENSSL_DIR"], "bin", "libeay32.dll"), + ], qtlibs = ["QtCore4", "QtGui4", "QtNetwork4", "QtWebKit4", "phonon4"]) + if "dist" in COMMAND_LINE_TARGETS or env.GetOption("clean") : myenv.Append(NSIS_OPTIONS = [ "/DmsvccRedistributableDir=\"" + env["vcredist"] + "\"", "/DbuildDate=" + datetime.date.today().strftime("%Y%m%d") |