comparison gen/linker.cpp @ 863:6c850977a941

modified gen/linker.cpp to only append .exe suffix on windows if not already present
author elrood
date Thu, 18 Dec 2008 19:24:33 +0100
parents 855e0ef78fa2
children 5a03f3f74615
comparison
equal deleted inserted replaced
862:e8337278f49b 863:6c850977a941
70 if (Module::rootModule) 70 if (Module::rootModule)
71 exestr = Module::rootModule->toChars(); 71 exestr = Module::rootModule->toChars();
72 else 72 else
73 exestr = "a.out"; 73 exestr = "a.out";
74 } 74 }
75 if (global.params.os == OSWindows) 75 if (global.params.os == OSWindows && !(exestr.substr(exestr.length()-4) == ".exe"))
76 exestr.append(".exe"); 76 exestr.append(".exe");
77 77
78 std::string outopt = "-o=" + exestr; 78 std::string outopt = "-o=" + exestr;
79 args.push_back(outopt.c_str()); 79 args.push_back(outopt.c_str());
80 80
238 else if (global.params.objfiles->dim) 238 else if (global.params.objfiles->dim)
239 exestr = FileName::removeExt((char*)global.params.objfiles->data[0]); 239 exestr = FileName::removeExt((char*)global.params.objfiles->data[0]);
240 else 240 else
241 exestr = "a.out"; 241 exestr = "a.out";
242 } 242 }
243 if (global.params.os == OSWindows) 243 if (global.params.os == OSWindows && !(exestr.rfind(".exe") == exestr.length()-4))
244 exestr.append(".exe"); 244 exestr.append(".exe");
245 245
246 args.push_back("-o"); 246 args.push_back("-o");
247 args.push_back(exestr.c_str()); 247 args.push_back(exestr.c_str());
248 248