diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-08-11 19:16:25 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-08-11 19:16:25 (GMT) |
commit | 3f94565804fce16c98e77e59934e87f95c2b1320 (patch) | |
tree | ccc5f8f8a8fe4a336a80779ea438799744a2c6a2 | |
parent | ebb5870b75cb914877715ed031c6474acda36c46 (diff) | |
download | swift-3f94565804fce16c98e77e59934e87f95c2b1320.zip swift-3f94565804fce16c98e77e59934e87f95c2b1320.tar.bz2 |
Add Swift Windows bundling.
-rw-r--r-- | SConstruct | 5 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 30 |
2 files changed, 30 insertions, 5 deletions
@@ -92,6 +92,7 @@ if int(ARGUMENTS.get("V", 0)) == 0: env["QT4_MOCFROMCXXCOMSTR"] = " \033[0;34;140mMOC\033[0m $TARGET" env["GENCOMSTR"] = " \033[0;34;140mGEN\033[0m $TARGET" env["RCCOMSTR"] = " \033[0;34;140mRC\033[0m $TARGET" + env["BUNDLECOMSTR"] = " \033[0;34;140mBUNDLE\033[0m $TARGET" #Progress( " \033[0;35;140mDEP\033[0m $TARGET\n") else : env["CCCOMSTR"] = " CC $TARGET" @@ -105,10 +106,13 @@ if int(ARGUMENTS.get("V", 0)) == 0: env["QT4_MOCFROMCXXCOMSTR"] = " MOC $TARGET" env["GENCOMSTR"] = " GEN $TARGET" env["RCCOMSTR"] = " RC $TARGET" + env["BUNDLECOMSTR"] = " BUNDLE $TARGET" #Progress(' DEP $TARGET\n') if env["PLATFORM"] == "win32" : env["MSVC_BATCH"] = 1 + env["LINKCOM"] = [env["LINKCOM"], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1'] + env["SHLINKCOM"] = [env["SHLINKCOM"], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2'] ################################################################################ @@ -163,6 +167,7 @@ if openssl_prefix : openssl_flags = { "CPPPATH": [os.path.join(openssl_prefix, "include")] } if env["PLATFORM"] == "win32" : openssl_flags["LIBPATH"] = [os.path.join(openssl_prefix, "lib", "VC")] + env["OPENSSL_DIR"] = openssl_prefix else : openssl_flags["LIBPATH"] = [os.path.join(openssl_prefix, "lib")] openssl_env.MergeFlags(openssl_flags) diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 2fd1bc1..0c458a1 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -1,4 +1,4 @@ -import os +import os, shutil def generateDefaultTheme(env, target, source) : sourceDir = source[0].abspath @@ -15,7 +15,7 @@ def generateDefaultTheme(env, target, source) : output.write("</qresource>") output.write("</RCC>") -def createBundle(env, target, source) : +def createAppBundle(env, target, source) : target = target[0].abspath source = source[0].abspath os.makedirs(target + "/Contents/MacOS") @@ -24,9 +24,17 @@ def createBundle(env, target, source) : pkgInfo.write("APPL\77\77\77\77") pkgInfo.close() +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"]) @@ -79,13 +87,25 @@ if env["PLATFORM"] == "win32" : sources += ["../resources/Windows/Swift.res"] if env["PLATFORM"] == "darwin" or env["PLATFORM"] == "win32" : - myenv.Program("Swift", sources) + swiftProgram = myenv.Program("Swift", sources) else : - myenv.Program("swift", sources) + swiftProgram = myenv.Program("swift", sources) myenv.Uic4("QtJoinMUCDialog.ui") myenv.Qrc("DefaultTheme.qrc") myenv.Qrc("Swift.qrc") if env["PLATFORM"] == "darwin" : - myenv.Command("Swift.app", "Swift", createBundle) + myenv.Command("Swift.app", "Swift", createAppBundle) + +if env["PLATFORM"] == "win32" : + 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")), + ]) |