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:
kai
2012-09-05 18:09:07 +02:00
parent af69672dc7
commit 9a3cdf2e10
5 changed files with 10 additions and 15 deletions

View File

@@ -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;
}