mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-28 17:04:34 +00:00
Make Karl Zylinski happy
This commit is contained in:
@@ -509,6 +509,7 @@ struct BuildContext {
|
||||
bool show_more_timings;
|
||||
bool show_defineables;
|
||||
String export_defineables_file;
|
||||
bool ignore_unused_defineables;
|
||||
bool show_system_calls;
|
||||
bool keep_temp_files;
|
||||
bool ignore_unknown_attributes;
|
||||
|
||||
15
src/main.cpp
15
src/main.cpp
@@ -334,6 +334,7 @@ enum BuildFlagKind {
|
||||
|
||||
BuildFlag_ShowDefineables,
|
||||
BuildFlag_ExportDefineables,
|
||||
BuildFlag_IgnoreUnusedDefineables,
|
||||
|
||||
BuildFlag_Vet,
|
||||
BuildFlag_VetShadowing,
|
||||
@@ -563,6 +564,7 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
||||
|
||||
add_flag(&build_flags, BuildFlag_ShowDefineables, str_lit("show-defineables"), BuildFlagParam_None, Command__does_check);
|
||||
add_flag(&build_flags, BuildFlag_ExportDefineables, str_lit("export-defineables"), BuildFlagParam_String, Command__does_check);
|
||||
add_flag(&build_flags, BuildFlag_IgnoreUnusedDefineables, str_lit("ignore-unused-defineables"), BuildFlagParam_None, Command__does_check);
|
||||
|
||||
add_flag(&build_flags, BuildFlag_Vet, str_lit("vet"), BuildFlagParam_None, Command__does_check);
|
||||
add_flag(&build_flags, BuildFlag_VetUnused, str_lit("vet-unused"), BuildFlagParam_None, Command__does_check);
|
||||
@@ -945,6 +947,11 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
||||
|
||||
break;
|
||||
}
|
||||
case BuildFlag_IgnoreUnusedDefineables: {
|
||||
GB_ASSERT(value.kind == ExactValue_Invalid);
|
||||
build_context.ignore_unused_defineables = true;
|
||||
break;
|
||||
}
|
||||
case BuildFlag_ShowSystemCalls: {
|
||||
GB_ASSERT(value.kind == ExactValue_Invalid);
|
||||
build_context.show_system_calls = true;
|
||||
@@ -2882,6 +2889,10 @@ gb_internal int print_show_help(String const arg0, String command, String option
|
||||
print_usage_line(2, "Shows an overview of all the #config/#defined usages in the project.");
|
||||
}
|
||||
|
||||
if (print_flag("-ignore-unused-defineables")) {
|
||||
print_usage_line(2, "Silence warning/error if a -define doesn't have at least one #config/#defined usage.");
|
||||
}
|
||||
|
||||
if (print_flag("-show-system-calls")) {
|
||||
print_usage_line(2, "Prints the whole command and arguments for calls to external tools like linker and assembler.");
|
||||
}
|
||||
@@ -3891,7 +3902,9 @@ int main(int arg_count, char const **arg_ptr) {
|
||||
|
||||
MAIN_TIME_SECTION("type check");
|
||||
check_parsed_files(checker);
|
||||
check_defines(&build_context, checker);
|
||||
if (!build_context.ignore_unused_defineables) {
|
||||
check_defines(&build_context, checker);
|
||||
}
|
||||
if (any_errors()) {
|
||||
print_all_errors();
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user