mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Also clean up .dSym on Darwin
This commit is contained in:
+18
-10
@@ -288,7 +288,7 @@ enum BuildPath : u8 {
|
|||||||
BuildPath_VS_LIB, // vs_library_path
|
BuildPath_VS_LIB, // vs_library_path
|
||||||
|
|
||||||
BuildPath_Output, // Output Path for .exe, .dll, .so, etc. Can be overridden with `-out:`.
|
BuildPath_Output, // Output Path for .exe, .dll, .so, etc. Can be overridden with `-out:`.
|
||||||
BuildPath_PDB, // Output Path for .pdb file, can be overridden with `-pdb-name:`.
|
BuildPath_Symbols, // Output Path for .pdb or .dSym file, can be overridden with `-pdb-name:`.
|
||||||
|
|
||||||
BuildPathCOUNT,
|
BuildPathCOUNT,
|
||||||
};
|
};
|
||||||
@@ -2292,15 +2292,23 @@ gb_internal bool init_build_paths(String init_filename) {
|
|||||||
bc->build_paths[BuildPath_Output] = output_path;
|
bc->build_paths[BuildPath_Output] = output_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (build_context.metrics.os == TargetOs_windows && build_context.ODIN_DEBUG) {
|
if (build_context.ODIN_DEBUG) {
|
||||||
if (bc->pdb_filepath.len > 0) {
|
if (build_context.metrics.os == TargetOs_windows) {
|
||||||
bc->build_paths[BuildPath_PDB] = path_from_string(ha, bc->pdb_filepath);
|
if (bc->pdb_filepath.len > 0) {
|
||||||
} else {
|
bc->build_paths[BuildPath_Symbols] = path_from_string(ha, bc->pdb_filepath);
|
||||||
Path pdb_path;
|
} else {
|
||||||
pdb_path.basename = copy_string(ha, bc->build_paths[BuildPath_Output].basename);
|
Path symbol_path;
|
||||||
pdb_path.name = copy_string(ha, bc->build_paths[BuildPath_Output].name);
|
symbol_path.basename = copy_string(ha, bc->build_paths[BuildPath_Output].basename);
|
||||||
pdb_path.ext = copy_string(ha, STR_LIT("pdb"));
|
symbol_path.name = copy_string(ha, bc->build_paths[BuildPath_Output].name);
|
||||||
bc->build_paths[BuildPath_PDB] = pdb_path;
|
symbol_path.ext = copy_string(ha, STR_LIT("pdb"));
|
||||||
|
bc->build_paths[BuildPath_Symbols] = symbol_path;
|
||||||
|
}
|
||||||
|
} else if (build_context.metrics.os == TargetOs_darwin) {
|
||||||
|
Path symbol_path;
|
||||||
|
symbol_path.basename = copy_string(ha, bc->build_paths[BuildPath_Output].basename);
|
||||||
|
symbol_path.name = copy_string(ha, bc->build_paths[BuildPath_Output].name);
|
||||||
|
symbol_path.ext = copy_string(ha, STR_LIT("dSym"));
|
||||||
|
bc->build_paths[BuildPath_Symbols] = symbol_path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -281,9 +281,9 @@ try_cross_linking:;
|
|||||||
link_settings = gb_string_append_fmt(link_settings, " /ENTRY:mainCRTStartup");
|
link_settings = gb_string_append_fmt(link_settings, " /ENTRY:mainCRTStartup");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (build_context.build_paths[BuildPath_PDB].name != "") {
|
if (build_context.build_paths[BuildPath_Symbols].name != "") {
|
||||||
String pdb_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_PDB]);
|
String symbol_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_Symbols]);
|
||||||
link_settings = gb_string_append_fmt(link_settings, " /PDB:\"%.*s\"", LIT(pdb_path));
|
link_settings = gb_string_append_fmt(link_settings, " /PDB:\"%.*s\"", LIT(symbol_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (build_context.build_mode != BuildMode_StaticLibrary) {
|
if (build_context.build_mode != BuildMode_StaticLibrary) {
|
||||||
|
|||||||
+7
-5
@@ -3890,12 +3890,14 @@ end_of_code_gen:;
|
|||||||
char const *filename = cast(char const *)exe_name.text;
|
char const *filename = cast(char const *)exe_name.text;
|
||||||
gb_file_remove(filename);
|
gb_file_remove(filename);
|
||||||
|
|
||||||
if (build_context.metrics.os == TargetOs_windows && build_context.ODIN_DEBUG) {
|
if (build_context.ODIN_DEBUG) {
|
||||||
String pdb_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_PDB]);
|
if (build_context.metrics.os == TargetOs_windows || build_context.metrics.os == TargetOs_darwin) {
|
||||||
defer (gb_free(heap_allocator(), pdb_path.text));
|
String symbol_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_Symbols]);
|
||||||
|
defer (gb_free(heap_allocator(), symbol_path.text));
|
||||||
|
|
||||||
filename = cast(char const *)pdb_path.text;
|
filename = cast(char const *)symbol_path.text;
|
||||||
gb_file_remove(filename);
|
gb_file_remove(filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user