Skip to content

Commit

Permalink
Scons: Workaround for command line length limit for gcc.
Browse files Browse the repository at this point in the history
* This should improve MinGW64, gcc, and clang all at the same time,
  although the later ones have lower limits from the OS of course.
  • Loading branch information
kayhayen committed Apr 13, 2019
1 parent 40e980c commit 412188e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nuitka/build/SingleExe.scons
Expand Up @@ -1748,8 +1748,24 @@ createBuildDefinitionsFile()
if show_scons_mode:
print("Scons: Launching target:", target)

# Hack to make Scons use tempfile for gcc linking.
if gcc_mode:
tmp_linker_filename = os.path.join(source_dir, "@sources.tmp")

env["LINKCOM"] = env["LINKCOM"].replace(
"$SOURCES", "@%s" % env.get("ESCAPE", lambda x: x)(tmp_linker_filename)
)

with open(tmp_linker_filename, "w") as tmpfile:
for filename in source_files:
filename = ".".join(filename.split(".")[:-1]) + ".o"
tmpfile.write('"%s"\n' % filename)

tmpfile.write(env.subst("$SOURCES"))

Default(target) # @UndefinedVariable


# Copy the Python DLL to the target directory, so the executable can be run.
if uninstalled_python:
if win_target:
Expand Down

0 comments on commit 412188e

Please sign in to comment.