diff options
author | Zoltan Varga <vargaz@gmail.com> | 2020-02-26 07:56:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 07:56:18 +0300 |
commit | 91e026de9dbe4c00d8563c3270186ad682abf69b (patch) | |
tree | 35831b2ae1419cb48cab3199dc4017105129641b /sdks | |
parent | 5c8da9e28456a8fca32bf4f5104d85c467e002bf (diff) |
[wasm] Improve error handling in the packager. (#19037)
Diffstat (limited to 'sdks')
-rw-r--r-- | sdks/wasm/packager.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sdks/wasm/packager.cs b/sdks/wasm/packager.cs index 72a1527235c..a2ce79d67b7 100644 --- a/sdks/wasm/packager.cs +++ b/sdks/wasm/packager.cs @@ -380,7 +380,6 @@ class Driver { string sdkdir = null; string emscripten_sdkdir = null; var aot_assemblies = ""; - out_prefix = Environment.CurrentDirectory; app_prefix = Environment.CurrentDirectory; var deploy_prefix = "managed"; var vfs_prefix = "managed"; @@ -499,6 +498,11 @@ class Driver { return 1; } + if (out_prefix == null) { + Console.Error.WriteLine ("The --appdir= argument is required."); + return 1; + } + enable_debug = opts.Debug; enable_linker = opts.Linker; add_binding = opts.AddBinding; @@ -521,8 +525,10 @@ class Driver { link_icalls = true; if (!enable_linker || !enable_aot) enable_dedup = false; - if (enable_aot || link_icalls || gen_pinvoke || profilers.Count > 0 || native_libs.Count > 0 || preload_files.Count > 0 || embed_files.Count > 0) + if (enable_aot || link_icalls || gen_pinvoke || profilers.Count > 0 || native_libs.Count > 0 || preload_files.Count > 0 || embed_files.Count > 0) { build_wasm = true; + emit_ninja = true; + } if (!enable_aot && link_icalls) enable_lto = true; if (ee_mode != ExecMode.Aot) @@ -728,6 +734,11 @@ class Driver { if (!emit_ninja) return 0; + if (builddir == null) { + Console.Error.WriteLine ("The --builddir argument is required."); + return 1; + } + var filenames = new Dictionary<string, string> (); foreach (var a in assemblies) { var assembly = a.src_path; |