mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-01 19:57:44 +00:00
47 lines
1.8 KiB
Python
47 lines
1.8 KiB
Python
# vi: syntax=python:et:ts=4
|
|
from os.path import join
|
|
from glob import glob
|
|
Import("env")
|
|
|
|
binaries = ["wesnoth", "wesnoth_editor"]
|
|
for bin in binaries:
|
|
#icon = env.Command(bin + "-icon.ico", join("../../icons", bin + "-icon.png"), "$IM_CONVERT $SOURCE $TARGET")
|
|
try:
|
|
res = [env.RES(bin + ".rc", CPPPATH=[])]
|
|
#env.Depends(res, icon)
|
|
except AttributeError:
|
|
res = []
|
|
locals()[bin + "_res"] = res
|
|
Export(bin + "_res")
|
|
|
|
if "windows-release" in COMMAND_LINE_TARGETS:
|
|
env.Tool("scanreplace", toolpath = ["../../scons"])
|
|
env["packaging_dir"] = Dir(".").abspath
|
|
iss = env.ScanReplace(join(env["windows_release_dir"], "Wesnoth.iss"), "Wesnoth.iss.in")
|
|
Depends(iss, Value(env.Dictionary()))
|
|
Alias("windows-release", iss)
|
|
|
|
docs = [ File(doc, "../..") for doc in Split("README COPYING copyright") ]
|
|
datadirs = [ Dir(dir, "../..") for dir in Split("data fonts images sounds translations") ]
|
|
dlls = glob("../../*.dll")
|
|
Alias("windows-release", env.InstallFiltered(Dir(env["windows_release_dir"]), datadirs))
|
|
Alias("windows-release", env.Install(env["windows_release_dir"], docs + dlls))
|
|
|
|
release_binaries = ["wesnoth", "wesnoth_editor", "wesnothd"]
|
|
builds = {
|
|
"" : "",
|
|
"_i486" : "-march=i486",
|
|
"_p2" : "-march=pentium2",
|
|
"_p4" : "-march=pentium4",
|
|
"_k6" : "-march=k6",
|
|
"_athlon" : "-march=athlon",
|
|
}
|
|
for build in builds.keys():
|
|
SConscript("../../src/SConscript",
|
|
build_dir = "../../build/release_win" + build,
|
|
exports = {"env":env.Clone(CXXFLAGS = builds[build])}
|
|
)
|
|
Import(release_binaries)
|
|
for bin in release_binaries:
|
|
Alias("windows-release", env.InstallAs("$windows_release_dir/%s%s$PROGSUFFIX" % (bin, build), eval(bin)))
|