Change default executable extension

Putting a program into your path on a UNIX system with a
file extension means that you have to type the extension out for every
invocation of the program. A better default is to have no extension at
all since most people will end up removing it anyway.

This change does not affect Windows since the .exe extension is set
after the default extension if compiling on Windows.
This commit is contained in:
Mark Naughton
2023-04-23 17:02:56 +01:00
parent 341ba34773
commit 47610725ea
+2 -4
View File
@@ -1497,13 +1497,11 @@ gb_internal bool init_build_paths(String init_filename) {
} else if (is_arch_wasm()) {
output_extension = STR_LIT("wasm");
} else if (build_context.build_mode == BuildMode_Executable) {
// By default use a .bin executable extension.
output_extension = STR_LIT("bin");
// By default use no executable extension.
output_extension = make_string(nullptr, 0);
if (build_context.metrics.os == TargetOs_windows) {
output_extension = STR_LIT("exe");
} else if (build_context.cross_compiling && selected_target_metrics->metrics == &target_essence_amd64) {
output_extension = make_string(nullptr, 0);
}
} else if (build_context.build_mode == BuildMode_DynamicLibrary) {
// By default use a .so shared library extension.