scons: fix paths when compiling .rc files

Previous way of addressing compiled .rc files led to stale intermediate
targets leading to issue #7441
This commit is contained in:
loonycyborg 2023-03-08 20:36:11 +03:00
parent 23678b247b
commit 9df0a5943f
No known key found for this signature in database
GPG Key ID: 6E8233FAB8F26D61
2 changed files with 7 additions and 8 deletions

View File

@ -8,12 +8,11 @@ binaries = ["wesnoth", "wesnothd"]
for bin in binaries:
try:
env["RCCOM"] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
res = [env.RES(bin + ".rc", CPPPATH=["#/"])]
res = env.RES(bin + ".rc", CPPPATH=["#/"])
if bin == "wesnoth":
Depends(res, File("wesnoth.exe.manifest"))
except AttributeError:
res = []
env[bin + "_res"] = res
Depends(env["wesnoth_res"], File("wesnoth.exe.manifest"))
pass
def WindowsInstaller(env, files):
files = [Entry(file) for file in Flatten(files)]

View File

@ -163,14 +163,14 @@ for env in [test_env, client_env, env]:
env.AddMethod(WesnothProgram)
#---wesnoth---
# for wesnoth_res and wesnothd_res, see packaging/windows/SConscript
# for packaging/windows/wesnoth?.o, see packaging/windows/SConscript
# used to set the executable icon for wesnoth and wesnothd
libwesnoth_objects = libwesnoth_client + liblua + libwesnoth_core + libwesnoth_game + libwesnoth_sdl + libwesnoth_client
if env["PLATFORM"] == 'darwin':
wesnoth = client_env.WesnothProgram("wesnoth", ["wesnoth.cpp"] + libwesnoth_objects + ["macosx/SDLMain.mm"], have_client_prereqs)
client_env.Append(LINKFLAGS=['-Wl,-force_load', libwesnoth_widgets])
elif env["PLATFORM"] == 'win32':
wesnoth = client_env.WesnothProgram("wesnoth", ["wesnoth.cpp"] + libwesnoth_objects + env["wesnoth_res"], have_client_prereqs)
wesnoth = client_env.WesnothProgram("wesnoth", ["wesnoth.cpp"] + libwesnoth_objects + ["#/packaging/windows/wesnoth.o"], have_client_prereqs)
client_env.Append(LINKFLAGS=['-Wl,--whole-archive', libwesnoth_widgets, '-Wl,--no-whole-archive'])
else:
wesnoth = client_env.WesnothProgram("wesnoth", ["wesnoth.cpp"] + libwesnoth_objects, have_client_prereqs)
@ -181,7 +181,7 @@ if have_client_prereqs:
#---wesnothd---
wesnothd_sources = GetSources("wesnothd")
if env["PLATFORM"] == 'win32':
env.WesnothProgram("wesnothd", wesnothd_sources + libwesnoth_core + env["wesnothd_res"], have_server_prereqs)
env.WesnothProgram("wesnothd", wesnothd_sources + libwesnoth_core + ["#/packaging/windows/wesnothd.o"], have_server_prereqs)
elif env["forum_user_handler"]:
env.WesnothProgram("wesnothd", wesnothd_sources + libwesnoth_core + libmariadbpp, have_server_prereqs)
else: