diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2020-12-06 00:49:48 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-06 00:49:48 +0000 |
| commit | f0683c910231513db9adab83f7c2fca9dd8d2613 (patch) | |
| tree | 2539634b5b71caf5148d8927c9298ba20bad5246 /src/build_settings.cpp | |
| parent | 54fbdabc380905a925ab5e922749fa2b1ccb2621 (diff) | |
| parent | ca4657fd31b9efc7ab52f7e1b6f4145d5ed28fb7 (diff) | |
Merge branch 'master' into parser-experiments
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 931dcf88e..b4c414f03 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -104,6 +104,37 @@ enum BuildModeKind { BuildMode_Assembly, }; +enum CommandKind : u32 { + Command_run = 1<<0, + Command_build = 1<<1, + Command_check = 1<<3, + Command_query = 1<<4, + Command_doc = 1<<5, + Command_version = 1<<6, + Command_test = 1<<7, + + Command__does_check = Command_run|Command_build|Command_check|Command_query|Command_doc|Command_test, + Command__does_build = Command_run|Command_build|Command_test, + Command_all = ~(u32)0, +}; + +char const *odin_command_strings[32] = { + "run", + "build", + "check", + "query", + "doc", + "version", +}; + + + +enum CmdDocFlag : u32 { + CmdDocFlag_Short = 1<<0, + CmdDocFlag_AllPackages = 1<<1, +}; + + // This stores the information for the specify architecture of this build struct BuildContext { @@ -124,6 +155,7 @@ struct BuildContext { i64 word_size; // Size of a pointer, must be >= 4 i64 max_align; // max alignment, must be >= 1 (and typically >= word_size) + CommandKind command_kind; String command; TargetMetrics metrics; @@ -143,6 +175,8 @@ struct BuildContext { bool generate_docs; i32 optimization_level; bool show_timings; + bool show_unused; + bool show_unused_with_location; bool show_more_timings; bool show_system_calls; bool keep_temp_files; @@ -151,6 +185,7 @@ struct BuildContext { bool no_dynamic_literals; bool no_output_files; bool no_crt; + bool no_entry_point; bool use_lld; bool vet; bool cross_compiling; @@ -165,6 +200,9 @@ struct BuildContext { bool ignore_microsoft_magic; bool linker_map_file; + u32 cmd_doc_flags; + Array<String> extra_packages; + QueryDataSetSettings query_data_set_settings; gbAffinity affinity; @@ -297,6 +335,19 @@ bool is_excluded_target_filename(String name) { String original_name = name; name = remove_extension_from_path(name); + if (string_starts_with(name, str_lit("."))) { + // Ignore .*.odin files + return true; + } + + String test_suffix = str_lit("_test"); + if (build_context.command_kind != Command_test) { + if (string_ends_with(name, test_suffix) && name != test_suffix) { + // Ignore *_test.odin files + return true; + } + } + String str1 = {}; String str2 = {}; isize n = 0; |