#include "wasm_emit.h"
#include "doc.h"
-#define VERSION "v0.1.4"
+#define VERSION "v0.1.5"
Context context;
arg_parse_start = argc;
bh_arr_push(options.files, bh_aprintf(alloc, "%s/tools/onyx-pkg.onyx", core_installation));
+ goto skip_parsing_arguments;
}
#ifdef ENABLE_RUN_WITH_WASMER
else if (!strcmp(argv[1], "run")) {
}
#endif
else {
+ char *script_filename = bh_aprintf(alloc, "%s/tools/%s.wasm", core_installation, argv[1]);
+ if (bh_file_exists(script_filename)) {
+ options.action = ONYX_COMPILE_ACTION_RUN_WASM;
+ options.target_file = script_filename;
+
+ options.passthrough_argument_count = argc - 2;
+ options.passthrough_argument_data = &argv[2];
+ goto skip_parsing_arguments;
+ }
+
bh_printf("Unknown subcommand: '%s'\n", argv[1]);
bh_printf("Run \"onyx help\" for valid subcommands.\n");
exit(1);
}
}
+ skip_parsing_arguments:
+
// NOTE: Always enable multi-threading for the Onyx runtime.
if (options.runtime == Runtime_Onyx) {
options.use_multi_threading = 1;
"""
--clean Remove directories of unneeded dependencies. This is not the default
behavior, as it could break builds.
+
+--skip-native Skips compiling native libraries during synchronization.
"""
}
run_sync_command :: (args: [] cstr) {
Sync_Options :: struct {
#tag "--clean"
clean := false;
+
+ #tag "--skip-native"
+ skip_native := false;
}
options: Sync_Options;
arg_parse.arg_parse(args, &options);
continue;
}
- success, installed_folder := install_package(to_install.pack, to_install.downgrade_if_necessary);
+ success, installed_folder := install_package(to_install.pack, to_install.downgrade_if_necessary, options.skip_native);
if !success {
error_print("Aborting sync.\n");
return;
}
-install_package :: (pack: Package, downgrade_if_necessary := false) -> (bool, installed_folder: str) {
+install_package :: (pack: Package, downgrade_if_necessary := false, skip_native_compilation := false) -> (bool, installed_folder: str) {
package_folder := get_install_path_of_repo(pack.repo);
if os.file_exists(package_folder) {
error_print("Failed to fetch {} version {}.\n", pack.repo, pack.version);
return false, "";
}
+
+ if skip_native_compilation do return true, package_folder;
install_success := run_native_library_installation(package_folder);
return install_success, package_folder;
}
build_package_file_to_load :: () {
+ if !os.dir_exists(config.config.lib_source_directory) {
+ os.dir_create(config.config.lib_source_directory);
+ }
+
filepath := os.path_join(config.config.lib_source_directory, "packages.onyx");
if os.file_exists(filepath) {