add /rad_alt_pch_dir for remapping objs in the local folder for pgo builds

This commit is contained in:
Nikita Smith
2025-09-22 10:06:21 -07:00
parent ee75ada087
commit 371e52ad42
5 changed files with 31 additions and 7 deletions
+10
View File
@@ -124,6 +124,7 @@ global read_only LNK_CmdSwitch g_cmd_switch_map[] =
//- internal switches
{ LNK_CmdSwitch_Rad_Age, 0, "RAD_AGE", ":#", "Age embeded in EXE and PDB, used to validate incremental build. Default is 1." },
{ LNK_CmdSwitch_Rad_AltPchDir, 0, "RAD_ALT_PCH_DIR", ":PATH", "Alternative directory to search for PCH object files." },
{ LNK_CmdSwitch_Rad_BuildInfo, 0, "RAD_BUILD_INFO", "", "Print build info and exit." },
{ LNK_CmdSwitch_Rad_CheckUnusedDelayLoadDll, 0, "RAD_CHECK_UNUSED_DELAY_LOAD_DLL", "[:NO]", "" },
{ LNK_CmdSwitch_Rad_Map, 0, "RAD_MAP", ":FILENAME", "Emit file with the output image's layout description." },
@@ -1779,6 +1780,15 @@ lnk_apply_cmd_option_to_config(LNK_Config *config, String8 cmd_name, String8List
lnk_cmd_switch_parse_u32(obj, cmd_switch, value_strings, &config->age, 0);
} break;
case LNK_CmdSwitch_Rad_AltPchDir: {
if (value_strings.node_count == 0) {
lnk_error_cmd_switch(LNK_Error_Cmdl, obj, cmd_switch, "missing parameters");
break;
}
String8List dirs = str8_list_copy(config->arena, &value_strings);
str8_list_concat_in_place(&config->alt_pch_dirs, &dirs);
} break;
case LNK_CmdSwitch_Rad_BuildInfo: {
lnk_print_build_info();
os_abort(0);