mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 07:42:33 +02:00
lazbuild: do not compile to lazarus.new.exe, bug #19474
git-svn-id: trunk@31034 -
This commit is contained in:
parent
eabbb9d096
commit
a39784ea7c
@ -68,7 +68,8 @@ type
|
||||
blfOnlyIDE, // skip all but IDE
|
||||
blfDontClean, // ignore clean up
|
||||
blfWithStaticPackages, // build with IDE static design time packages
|
||||
blfUseMakeIDECfg // use idemake.cfg
|
||||
blfUseMakeIDECfg, // use idemake.cfg
|
||||
blfReplaceExe // ignore OSLocksExecutables and do not create lazarus.new.exe
|
||||
);
|
||||
TBuildLazarusFlags = set of TBuildLazarusFlag;
|
||||
|
||||
@ -410,6 +411,7 @@ var
|
||||
CrossCompiling: Boolean;
|
||||
CurTargetFilename: String;
|
||||
BundleDir: String;
|
||||
ExeLocked: Boolean;
|
||||
begin
|
||||
Result:=mrOk;
|
||||
Options:=Profiles.Current;
|
||||
@ -472,6 +474,9 @@ begin
|
||||
if NewTargetOS='' then NewTargetOS:=DefaultTargetOS;
|
||||
if NewTargetCPU='' then NewTargetCPU:=DefaultTargetCPU;
|
||||
CrossCompiling:=(CompareText(NewTargetOS,DefaultTargetOS)<>0) or (CompareText(NewTargetCPU,DefaultTargetCPU)<>0);
|
||||
ExeLocked:=OSLocksExecutables and (not (blfReplaceExe in Flags))
|
||||
and (not CrossCompiling);
|
||||
|
||||
//DebugLn(['CreateBuildLazarusOptions NewTargetOS=',NewTargetOS,' NewTargetCPU=',NewTargetCPU]);
|
||||
if (Options.TargetDirectory<>'') then begin
|
||||
// Case 1. the user has set a target directory
|
||||
@ -485,7 +490,7 @@ begin
|
||||
debugln('CreateBuildLazarusOptions Options.TargetDirectory=',NewTargetDirectory);
|
||||
Result:=ForceDirectoryInteractive(NewTargetDirectory,[]);
|
||||
if Result<>mrOk then exit;
|
||||
if OSLocksExecutables and not CrossCompiling then begin
|
||||
if ExeLocked then begin
|
||||
// Allow for the case where this corresponds to the current executable
|
||||
NewTargetFilename:='lazarus'+GetExecutableExt(NewTargetOS);
|
||||
if FileExistsUTF8(AppendPathDelim(NewTargetDirectory)+NewTargetFilename) then
|
||||
@ -529,7 +534,7 @@ begin
|
||||
if Result<>mrOk then exit;
|
||||
end else begin
|
||||
// the lazarus directory is writable
|
||||
if OSLocksExecutables then begin
|
||||
if ExeLocked then begin
|
||||
// Case 4. the current executable is locked
|
||||
// => use a different output name
|
||||
NewTargetFilename:='lazarus.new'+GetExecutableExt(NewTargetOS);
|
||||
|
@ -428,18 +428,6 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
// first compile all lazarus components (LCL, SynEdit, CodeTools, ...)
|
||||
// but not the IDE
|
||||
CurResult:=BuildLazarus(BuildLazProfiles,
|
||||
EnvironmentOptions.ExternalTools,GlobalMacroList,
|
||||
'',EnvironmentOptions.CompilerFilename,
|
||||
EnvironmentOptions.MakeFilename,
|
||||
Flags+[blfWithoutCompilingIDE,blfWithoutLinkingIDE]);
|
||||
if CurResult<>mrOk then begin
|
||||
DebugLn('TLazBuildApplication.BuildLazarusIDE: Building standard components (LCL, SynEdit, CodeTools) failed.');
|
||||
exit;
|
||||
end;
|
||||
|
||||
// compile auto install static packages
|
||||
if not CompileAutoInstallPackages then begin
|
||||
DebugLn('TLazBuildApplication.BuildLazarusIDE: Compile AutoInstall Packages failed.');
|
||||
@ -463,7 +451,7 @@ begin
|
||||
EnvironmentOptions.ExternalTools,GlobalMacroList,
|
||||
PkgOptions,EnvironmentOptions.CompilerFilename,
|
||||
EnvironmentOptions.MakeFilename,
|
||||
Flags+[blfUseMakeIDECfg,blfOnlyIDE]
|
||||
Flags+[blfUseMakeIDECfg,blfOnlyIDE,blfReplaceExe]
|
||||
);
|
||||
if CurResult<>mrOk then begin
|
||||
DebugLn('TLazBuildApplication.BuildLazarusIDE: Building IDE failed.');
|
||||
|
Loading…
Reference in New Issue
Block a user