diff --git a/releasenotes.md b/releasenotes.md index 9b5ef3c6b..6a7c04ddb 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -3,6 +3,8 @@ ## 0.5.0 Change List ### Changes / improvements +- 'exec' directive to run scripts at compile time. +- Project key descriptions in --list command. - Added `init-lib` to simplify library creation. - Local `const` work like namespaced global `const`. - Added `$$atomic_fetch_*` builtins. diff --git a/resources/testfragments/pwd2.c3 b/resources/testfragments/pwd2.c3 new file mode 100644 index 000000000..2e86a9102 --- /dev/null +++ b/resources/testfragments/pwd2.c3 @@ -0,0 +1,3 @@ +module pwd; + +fn int getnum() => 3; \ No newline at end of file diff --git a/resources/testproject/run/run.md b/resources/testproject/scripts/scripts.md similarity index 100% rename from resources/testproject/run/run.md rename to resources/testproject/scripts/scripts.md diff --git a/src/build/build.h b/src/build/build.h index 35bb081b7..7aad1e1a2 100644 --- a/src/build/build.h +++ b/src/build/build.h @@ -355,6 +355,7 @@ typedef struct BuildOptions_ const char *llvm_out; const char *asm_out; const char *obj_out; + const char *script_dir; RelocModel reloc_model; X86VectorCapability x86_vector_capability; X86CpuSet x86_cpu_set; @@ -429,6 +430,7 @@ typedef struct const char *object_file_dir; const char *ir_file_dir; const char *asm_file_dir; + const char *script_dir; bool run_after_compile; bool generate_benchmark_runner; bool generate_test_runner; @@ -470,6 +472,7 @@ typedef struct const char *testfn; const char *cc; const char *cflags; + const char **exec; const char **csource_dirs; const char **csources; const char **feature_list; diff --git a/src/build/build_internal.h b/src/build/build_internal.h index 72918c209..cf5b5523e 100644 --- a/src/build/build_internal.h +++ b/src/build/build_internal.h @@ -25,6 +25,12 @@ static const char *wincrt_linking[3] = { [WIN_CRT_STATIC] = "static", }; +static const char *trust_level[3] = { + [TRUST_NONE] = "none", + [TRUST_INCLUDE] = "include", + [TRUST_FULL] = "full", +}; + static const char *optsizes[3] = { [SIZE_OPTIMIZATION_NONE] = "none", [SIZE_OPTIMIZATION_SMALL] = "small", diff --git a/src/build/build_options.c b/src/build/build_options.c index 294a2362d..7b41539b7 100644 --- a/src/build/build_options.c +++ b/src/build/build_options.c @@ -96,13 +96,12 @@ static void usage(void) OUTPUT(" -O5 - Unsafe, highest optimization, fast maths, single module, emit debug info."); OUTPUT(" -Os - Unsafe, high optimization, small code, single module, no debug info."); OUTPUT(" -Oz - Unsafe, high optimization, tiny code, single module, no debug info."); - OUTPUT(" -t1 - Trust level 1 - don't allow $include nor $exec (default)."); - OUTPUT(" -t2 - Trust level 2 - allow $include but not $exec / exec directives."); - OUTPUT(" -t3 - Trust level 3 - full trust, allow both include and exec."); OUTPUT(" -D - Add feature flag ."); OUTPUT(" -U - Remove feature flag ."); + OUTPUT(" --trust=