aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-10-30 23:24:34 +0100
committergingerBill <bill@gingerbill.org>2021-10-30 23:24:34 +0100
commit5bc8a491a7768da0019b7b17da637e681f2ace90 (patch)
tree71186a22f6fa5e54c83c8e300309ce2ffa0deeb7 /src/main.cpp
parent87952fdb8ed56fcf926bea81e3247ff3c6395e31 (diff)
Begin work on supporting `wasm64`; Correct `wasm32` compilation behaviour
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 92e541384..fad749e34 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -135,13 +135,20 @@ i32 linker_stage(lbGenerator *gen) {
if (is_arch_wasm()) {
timings_start_section(timings, str_lit("wasm-ld"));
- result = system_exec_command_line_app("wasm-ld",
- "\"%.*s\\bin\\wasm-ld\" \"%.*s.wasm-obj\" -o \"%.*s.wasm\" %.*s %.*s",
- LIT(build_context.ODIN_ROOT),
- LIT(output_base), LIT(output_base), LIT(build_context.link_flags), LIT(build_context.extra_linker_flags));
- if (result) {
- return result;
+
+ if (build_context.metrics.arch == TargetArch_wasm32) {
+ result = system_exec_command_line_app("wasm-ld",
+ "\"%.*s\\bin\\wasm-ld\" \"%.*s.wasm.o\" -o \"%.*s.wasm\" %.*s %.*s",
+ LIT(build_context.ODIN_ROOT),
+ LIT(output_base), LIT(output_base), LIT(build_context.link_flags), LIT(build_context.extra_linker_flags));
+ } else {
+ GB_ASSERT(build_context.metrics.arch == TargetArch_wasm64);
+ result = system_exec_command_line_app("wasm-ld",
+ "\"%.*s\\bin\\wasm-ld\" \"%.*s.wasm.o\" -o \"%.*s.wasm\" %.*s %.*s",
+ LIT(build_context.ODIN_ROOT),
+ LIT(output_base), LIT(output_base), LIT(build_context.link_flags), LIT(build_context.extra_linker_flags));
}
+ return result;
}
if (build_context.cross_compiling && selected_target_metrics->metrics == &target_essence_amd64) {