mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 00:23:14 +01:00
Use .obj extension on Windows.
The Windows linker LINK insists on the .obj extension. The following changes are made: - CMake uses the same extension as the C compiler - global.obj_ext_alt (aka .obj) is recognized as objectfile extension - global.obj_ext_alt is used on Windows
This commit is contained in:
@@ -391,17 +391,16 @@ int main(int argc, char** argv)
|
||||
} else if (strcmp(ext, global.s_ext) == 0) {
|
||||
global.params.output_s = OUTPUTFLAGset;
|
||||
autofound = true;
|
||||
} else if (strcmp(ext, global.obj_ext) == 0) {
|
||||
} else if (strcmp(ext, global.obj_ext) == 0 || strcmp(ext, global.obj_ext_alt) == 0) {
|
||||
global.params.output_o = OUTPUTFLAGset;
|
||||
autofound = true;
|
||||
} else {
|
||||
// append dot, so forceExt won't change existing name even if it contains dots
|
||||
size_t len = strlen(global.params.objname);
|
||||
size_t extlen = strlen(".");
|
||||
char* s = static_cast<char *>(mem.malloc(len + 1 + extlen + 1));
|
||||
char* s = static_cast<char *>(mem.malloc(len + 1 + 1));
|
||||
memcpy(s, global.params.objname, len);
|
||||
s[len] = '.';
|
||||
s[len+1+extlen] = 0;
|
||||
s[len+1] = 0;
|
||||
global.params.objname = s;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user