improved updateOutFilename under windows

This commit is contained in:
Basile Burg 2015-01-16 07:39:26 +01:00
parent 3998394c58
commit 9c22892361
2 changed files with 13 additions and 5 deletions

View File

@ -5,7 +5,7 @@ object CurrentProject: TCEProject
messagesOptions.additionalWarnings = True
outputOptions.boundsCheck = onAlways
outputOptions.unittest = True
pathsOptions.outputFilename = '..\lazproj\cetodo.exe'
pathsOptions.outputFilename = '..\lazproj\cetodo'
preBuildProcess.options = []
preBuildProcess.showWindow = swoNone
postBuildProcess.options = []
@ -22,7 +22,7 @@ object CurrentProject: TCEProject
outputOptions.boundsCheck = offAlways
outputOptions.optimizations = True
outputOptions.release = True
pathsOptions.outputFilename = '..\lazproj\cetodo.exe'
pathsOptions.outputFilename = '..\lazproj\cetodo'
preBuildProcess.options = []
preBuildProcess.showWindow = swoNone
postBuildProcess.options = []
@ -33,7 +33,7 @@ object CurrentProject: TCEProject
Sources.Strings = (
'cetodo.d'
)
ConfigurationIndex = 1
ConfigurationIndex = 0
LibraryAliases.Strings = (
'libdparse'
)

View File

@ -457,14 +457,22 @@ procedure TCEProject.updateOutFilename;
begin
fOutputFilename := currentConfiguration.pathsOptions.outputFilename;
// field is specified
if fOutputFilename <> '' then begin
if fOutputFilename <> '' then
begin
fOutputFilename := symbolExpander.get(fOutputFilename);
fOutputFilename := getAbsoluteFilename(fOutputFilename);
{$IFDEF WINDOWS}
// field is specified without ext or with a dot in the name.
// DMD will add the ext. (e.g: "-ofresourced")
if fileexists(fOutputFilename + exeExt) then
if currentConfiguration.outputOptions.binaryKind = executable then
fOutputFilename := fOutputFilename + exeExt;
{$ENDIF}
end
// try to guess
else if Sources.Count > 0 then
begin
// ideally, main() should be searched for, when project type is executable
// ideally, main() should be searched for, when project binaryKind is executable
fOutputFilename := extractFilename(Sources.Strings[0]);
fOutputFilename := stripFileExt(fOutputFilename);
if FileExists(fileName) then