diff options
| author | Mark Naughton <mark@marknaughton.com> | 2023-04-24 12:57:59 +0100 |
|---|---|---|
| committer | Mark Naughton <mark@marknaughton.com> | 2023-04-24 12:57:59 +0100 |
| commit | 780375d8654363f7de1eb95278b979d80a9a9775 (patch) | |
| tree | a828a5a091323dfa8b4eb28769b799488bd895ac /src/build_settings.cpp | |
| parent | cbcf94669e138a1afcfc8d581257e81b138fbdb9 (diff) | |
Add .bin extension in extra case
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index d6b29709a..1bef4b6ad 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -1502,9 +1502,15 @@ gb_internal bool init_build_paths(String init_filename) { if (build_context.metrics.os == TargetOs_windows) { output_extension = STR_LIT("exe"); - } else if (!str_eq(init_filename, str_lit(".")) && path_is_directory(last_path_element(init_filename))) { - // Add .bin extension to avoid collision - // with package directory name + } else if (str_eq(init_filename, str_lit("."))) { + // 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 + // with package directory name + output_extension = STR_LIT("bin"); + } + } else if (path_is_directory(last_path_element(init_filename))) { output_extension = STR_LIT("bin"); } } else if (build_context.build_mode == BuildMode_DynamicLibrary) { |