From 47f460d31a4257019aaee1414124273cdf5b6593 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 20 Dec 2014 17:35:30 +0100 Subject: [PATCH] re-enabled ext constraint only if outputFilename is guessed --- src/ce_project.pas | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ce_project.pas b/src/ce_project.pas index 59dafa70..7595f39c 100644 --- a/src/ce_project.pas +++ b/src/ce_project.pas @@ -444,20 +444,21 @@ begin // try to guess else if Sources.Count > 0 then begin + // ideally, main() should be searched for, when project type is executable fOutputFilename := extractFilename(Sources.Strings[0]); fOutputFilename := stripFileExt(fOutputFilename); if FileExists(fileName) then fOutputFilename := extractFilePath(fileName) + fOutputFilename else fOutputFilename := GetTempDir(false) + fOutputFilename; + // force extension + case currentConfiguration.outputOptions.binaryKind of + executable: fOutputFilename := ChangeFileExt(fOutputFilename, exeExt); + staticlib: fOutputFilename := ChangeFileExt(fOutputFilename, libExt); + sharedlib: fOutputFilename := ChangeFileExt(fOutputFilename, dynExt); + obj: fOutputFilename := ChangeFileExt(fOutputFilename, objExt); + end; end; - // force extension - //case currentConfiguration.outputOptions.binaryKind of - // executable: fOutputFilename := ChangeFileExt(fOutputFilename, exeExt); - // staticlib: fOutputFilename := ChangeFileExt(fOutputFilename, libExt); - // sharedlib: fOutputFilename := ChangeFileExt(fOutputFilename, dynExt); - // obj: fOutputFilename := ChangeFileExt(fOutputFilename, objExt); - //end; // fCanBeRun := false; if currentConfiguration.outputOptions.binaryKind = executable then