fix linker error using response file (p4 only)

This commit is contained in:
mverch67
2026-04-22 22:39:38 +02:00
parent 96538b492a
commit 8dc82c45b8
2 changed files with 24 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
# force linker response file instead of command line arguments
Import("env")
def wrap_with_tempfile(command_key):
command = env.get(command_key)
if not command or not isinstance(command, str):
return
if "TEMPFILE(" in command:
return
env.Replace(**{command_key: "${TEMPFILE('%s')}" % command})
# Force SCons to spill long commands into response files on this target.
env.Replace(MAXLINELENGTH=8192)
for key in ("LINKCOM", "CXXLINKCOM", "SHLINKCOM", "SHCXXLINKCOM"):
wrap_with_tempfile(key)