Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support cross compiling for wasm with make generator #222

Merged
merged 27 commits into from
Apr 2, 2024
Merged
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6c9a795
fix: support cross compiling for wasm with make generator
toyobayashi Jan 18, 2024
326246b
fix: lint
toyobayashi Jan 19, 2024
9bc7805
refactor for readability
toyobayashi Jan 19, 2024
882c1f9
replace separator in make generator on Windows
toyobayashi Jan 23, 2024
82d5d76
snake_case
toyobayashi Jan 24, 2024
6a757fc
found more place to replace sep
toyobayashi Jan 27, 2024
7fd6b7e
lint
toyobayashi Jan 27, 2024
be69f9f
replace sep in compiler path
toyobayashi Jan 28, 2024
7a62b19
fix sed unterminated `s' command error on Windows
toyobayashi Jan 28, 2024
64290b6
path includes `\` so replace the ended `\` only
toyobayashi Jan 28, 2024
77b8e9c
replace `\` with `/` in depfile on win
toyobayashi Jan 28, 2024
9f110ec
lint
toyobayashi Jan 28, 2024
1d82674
fix: trailing `\` in raw string
toyobayashi Jan 30, 2024
97d765c
revert: flavor can be set via `-f make-linux` so no need to change th…
toyobayashi Jan 30, 2024
ef48485
fix: also do not use raw string in windows branch due to trailing `\`…
toyobayashi Jan 30, 2024
fec298c
Merge branch 'nodejs:main' into wasm
toyobayashi Mar 8, 2024
f4410af
fix: respect user specified AR_target environment variable
toyobayashi Mar 20, 2024
840574c
feat: detect wasm flavor
toyobayashi Apr 1, 2024
3a72760
lint: Too many return statements
toyobayashi Apr 1, 2024
626f0a6
fix get compiler predefines on windows
toyobayashi Apr 1, 2024
9e9cb99
GetCrossCompilerPredefines always return dict
toyobayashi Apr 1, 2024
3b49a7b
do not broad exceptions
toyobayashi Apr 1, 2024
83274d9
test: GetCrossCompilerPredefines
toyobayashi Apr 1, 2024
04024d4
fix lint
toyobayashi Apr 1, 2024
a6cfb16
refactor: do not put so many lines in try block
toyobayashi Apr 1, 2024
4bf22c4
fix: finally block should wait until subprocess terminate
toyobayashi Apr 1, 2024
3a962e9
suggestion change
toyobayashi Apr 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,13 @@ def Write(
self.output = self.ComputeMacBundleOutput(spec)
self.output_binary = self.ComputeMacBundleBinaryOutput(spec)
else:
self.output = self.output_binary = self.ComputeOutput(spec)
if self.flavor == "win":
# prevent from generating copy targets on Windows
self.output = self.output_binary = self.ComputeOutput(spec).replace(
'\\', '/'
)
else:
self.output = self.output_binary = self.ComputeOutput(spec)

self.is_standalone_static_library = bool(
spec.get("standalone_static_library", 0)
Expand Down Expand Up @@ -2441,13 +2447,19 @@ def CalculateMakefilePath(build_file, base_name):
flock_command = "flock"
copy_archive_arguments = "-af"
makedep_arguments = "-MMD"

# some linkers don't support --start-group/--end-group (e.g. wasm-ld)
link_commands = LINK_COMMANDS_LINUX.replace(' -Wl,--start-group', '').replace(
' -Wl,--end-group', ''
) if gyp.common.CrossCompileRequested() else LINK_COMMANDS_LINUX
toyobayashi marked this conversation as resolved.
Show resolved Hide resolved

header_params = {
"default_target": default_target,
"builddir": builddir_name,
"default_configuration": default_configuration,
"flock": flock_command,
"flock_index": 1,
"link_commands": LINK_COMMANDS_LINUX,
"link_commands": link_commands,
"extra_commands": "",
"srcdir": srcdir,
"copy_archive_args": copy_archive_arguments,
Expand All @@ -2463,7 +2475,8 @@ def CalculateMakefilePath(build_file, base_name):
"LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"),
"PLI.host": GetEnvironFallback(("PLI_host", "PLI"), "pli"),
}
if flavor == "mac":
# If cross-compiling, reserve linux link commands and do not use gyp-mac-tool
if flavor == "mac" and not gyp.common.CrossCompileRequested():
flock_command = "./gyp-mac-tool flock"
header_params.update(
{
Expand Down
Loading