|
@@ -312,6 +312,7 @@ enum BuildFlagKind {
|
|
|
BuildFlag_Collection,
|
|
|
BuildFlag_Define,
|
|
|
BuildFlag_BuildMode,
|
|
|
+ BuildFlag_BuildOnly,
|
|
|
BuildFlag_Target,
|
|
|
BuildFlag_Subtarget,
|
|
|
BuildFlag_Debug,
|
|
@@ -531,6 +532,7 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
|
|
add_flag(&build_flags, BuildFlag_Collection, str_lit("collection"), BuildFlagParam_String, Command__does_check);
|
|
|
add_flag(&build_flags, BuildFlag_Define, str_lit("define"), BuildFlagParam_String, Command__does_check, true);
|
|
|
add_flag(&build_flags, BuildFlag_BuildMode, str_lit("build-mode"), BuildFlagParam_String, Command__does_build); // Commands_build is not used to allow for a better error message
|
|
|
+ add_flag(&build_flags, BuildFlag_BuildOnly, str_lit("build-only"), BuildFlagParam_None, Command_test);
|
|
|
add_flag(&build_flags, BuildFlag_Target, str_lit("target"), BuildFlagParam_String, Command__does_check);
|
|
|
add_flag(&build_flags, BuildFlag_Subtarget, str_lit("subtarget"), BuildFlagParam_String, Command__does_check);
|
|
|
add_flag(&build_flags, BuildFlag_Debug, str_lit("debug"), BuildFlagParam_None, Command__does_check);
|
|
@@ -1193,6 +1195,9 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
+ case BuildFlag_BuildOnly:
|
|
|
+ build_context.build_only = true;
|
|
|
+ break;
|
|
|
|
|
|
case BuildFlag_Debug:
|
|
|
build_context.ODIN_DEBUG = true;
|
|
@@ -2381,6 +2386,12 @@ gb_internal int print_show_help(String const arg0, String command, String option
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (test_only) {
|
|
|
+ if (print_flag("-build-only")) {
|
|
|
+ print_usage_line(2, "Only builds the test executable; does not automatically run it afterwards.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (check) {
|
|
|
if (print_flag("-collection:<name>=<filepath>")) {
|
|
|
print_usage_line(2, "Defines a library collection used for imports.");
|
|
@@ -3861,7 +3872,7 @@ end_of_code_gen:;
|
|
|
show_timings(checker, &global_timings);
|
|
|
}
|
|
|
|
|
|
- if (run_output) {
|
|
|
+ if (!build_context.build_only && run_output) {
|
|
|
String exe_name = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_Output]);
|
|
|
defer (gb_free(heap_allocator(), exe_name.text));
|
|
|
|