diff --git a/commands.go b/commands.go new file mode 100644 index 00000000..33eea1e8 --- /dev/null +++ b/commands.go @@ -0,0 +1,11 @@ +// +build !darwin + +package main + +// commands used by the compilation process might have different file names on Linux than those used on macOS. +var commands = map[string]string{ + "ar": "llvm-ar-7", + "clang": "clang-7", + "ld.lld": "ld.lld-7", + "wasm-ld": "wasm-ld-7", +} diff --git a/commands_macos.go b/commands_macos.go new file mode 100644 index 00000000..c40a20de --- /dev/null +++ b/commands_macos.go @@ -0,0 +1,11 @@ +// +build darwin + +package main + +// commands used by the compilation process might have different file names on macOS than those used on Linux. +var commands = map[string]string{ + "ar": "llvm-ar", + "clang": "clang-7", + "ld.lld": "ld.lld-7", + "wasm-ld": "wasm-ld-7", +} diff --git a/main.go b/main.go index d7a462c8..b9cb3d03 100644 --- a/main.go +++ b/main.go @@ -21,13 +21,6 @@ import ( "github.com/tinygo-org/tinygo/loader" ) -var commands = map[string]string{ - "ar": "llvm-ar", - "clang": "clang-7", - "ld.lld": "ld.lld-7", - "wasm-ld": "wasm-ld-7", -} - // commandError is an error type to wrap os/exec.Command errors. This provides // some more information regarding what went wrong while running a command. type commandError struct {