From cb894f41beeb4d15d17734e715ff674beb72eafe Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 1 Jul 2010 11:56:15 +0000 Subject: [PATCH] IDE: do not use -FE switch if not needed git-svn-id: trunk@26387 - --- ide/compileroptions.pp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index ecfc60cbcf..5cdc47d48a 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -2718,6 +2718,15 @@ begin if not (ccloAbsolutePaths in Flags) then NewTargetFilename := CreateRelativePath(NewTargetFilename, BaseDirectory); NewTargetDirectory := ExtractFilePath(NewTargetFilename); + if (NewTargetDirectory <> '') + and (CompareFilenames(ChompPathDelim(NewTargetDirectory),ChompPathDelim(BaseDirectory))=0) + then begin + // if target file is in base directory, do not use -FE switch + // Without -FE and -FU switch the compiler puts .ppu files in the source + // directories, which is Delphi compatible. + // See bug http://bugs.freepascal.org/view.php?id=15535 + NewTargetDirectory:=''; + end; if NewTargetDirectory <> '' then switches := switches + ' '+PrepareCmdLineOption('-FE' + NewTargetDirectory); NewTargetFileName := ExtractFileName(NewTargetFilename);