mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Simplify extension addition logic
This commit is contained in:
@@ -1502,18 +1502,11 @@ gb_internal bool init_build_paths(String init_filename) {
|
|||||||
|
|
||||||
if (build_context.metrics.os == TargetOs_windows) {
|
if (build_context.metrics.os == TargetOs_windows) {
|
||||||
output_extension = STR_LIT("exe");
|
output_extension = STR_LIT("exe");
|
||||||
} else if (str_eq(init_filename, str_lit("."))) {
|
} else if (path_is_directory(last_path_element(bc->build_paths[BuildPath_Main_Package].basename))) {
|
||||||
// Avoid conflict in edge case where directory to be compiled is
|
|
||||||
// the same as the current directory's name
|
|
||||||
if (path_is_directory(last_path_element(get_current_directory()))) {
|
|
||||||
// Add .bin extension to avoid collision
|
// Add .bin extension to avoid collision
|
||||||
// with package directory name
|
// with package directory name
|
||||||
output_extension = STR_LIT("bin");
|
output_extension = STR_LIT("bin");
|
||||||
}
|
}
|
||||||
// Path could be absolute or relative
|
|
||||||
} else if (path_is_directory(last_path_element(bc->build_paths[BuildPath_Main_Package].basename))) {
|
|
||||||
output_extension = STR_LIT("bin");
|
|
||||||
}
|
|
||||||
} else if (build_context.build_mode == BuildMode_DynamicLibrary) {
|
} else if (build_context.build_mode == BuildMode_DynamicLibrary) {
|
||||||
// By default use a .so shared library extension.
|
// By default use a .so shared library extension.
|
||||||
output_extension = STR_LIT("so");
|
output_extension = STR_LIT("so");
|
||||||
|
|||||||
Reference in New Issue
Block a user