Browse Source

Simplify extension addition logic

Mark Naughton 2 years ago
parent
commit
4b4481ea27
1 changed files with 2 additions and 9 deletions
  1. 2 9
      src/build_settings.cpp

+ 2 - 9
src/build_settings.cpp

@@ -1502,16 +1502,9 @@ 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("."))) {
-			// 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");
-			}
-		// Path could be absolute or relative
 		} else if (path_is_directory(last_path_element(bc->build_paths[BuildPath_Main_Package].basename))) {
 		} else if (path_is_directory(last_path_element(bc->build_paths[BuildPath_Main_Package].basename))) {
+			// Add .bin extension to avoid collision
+			// with package directory name
 			output_extension = STR_LIT("bin");
 			output_extension = STR_LIT("bin");
 		}
 		}
 	} else if (build_context.build_mode == BuildMode_DynamicLibrary) {
 	} else if (build_context.build_mode == BuildMode_DynamicLibrary) {