mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 22:40:24 +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
|
blfOnlyIDE, // skip all but IDE
|
||||||
blfDontClean, // ignore clean up
|
blfDontClean, // ignore clean up
|
||||||
blfWithStaticPackages, // build with IDE static design time packages
|
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;
|
TBuildLazarusFlags = set of TBuildLazarusFlag;
|
||||||
|
|
||||||
@ -410,6 +411,7 @@ var
|
|||||||
CrossCompiling: Boolean;
|
CrossCompiling: Boolean;
|
||||||
CurTargetFilename: String;
|
CurTargetFilename: String;
|
||||||
BundleDir: String;
|
BundleDir: String;
|
||||||
|
ExeLocked: Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
Options:=Profiles.Current;
|
Options:=Profiles.Current;
|
||||||
@ -472,6 +474,9 @@ begin
|
|||||||
if NewTargetOS='' then NewTargetOS:=DefaultTargetOS;
|
if NewTargetOS='' then NewTargetOS:=DefaultTargetOS;
|
||||||
if NewTargetCPU='' then NewTargetCPU:=DefaultTargetCPU;
|
if NewTargetCPU='' then NewTargetCPU:=DefaultTargetCPU;
|
||||||
CrossCompiling:=(CompareText(NewTargetOS,DefaultTargetOS)<>0) or (CompareText(NewTargetCPU,DefaultTargetCPU)<>0);
|
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]);
|
//DebugLn(['CreateBuildLazarusOptions NewTargetOS=',NewTargetOS,' NewTargetCPU=',NewTargetCPU]);
|
||||||
if (Options.TargetDirectory<>'') then begin
|
if (Options.TargetDirectory<>'') then begin
|
||||||
// Case 1. the user has set a target directory
|
// Case 1. the user has set a target directory
|
||||||
@ -485,7 +490,7 @@ begin
|
|||||||
debugln('CreateBuildLazarusOptions Options.TargetDirectory=',NewTargetDirectory);
|
debugln('CreateBuildLazarusOptions Options.TargetDirectory=',NewTargetDirectory);
|
||||||
Result:=ForceDirectoryInteractive(NewTargetDirectory,[]);
|
Result:=ForceDirectoryInteractive(NewTargetDirectory,[]);
|
||||||
if Result<>mrOk then exit;
|
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
|
// Allow for the case where this corresponds to the current executable
|
||||||
NewTargetFilename:='lazarus'+GetExecutableExt(NewTargetOS);
|
NewTargetFilename:='lazarus'+GetExecutableExt(NewTargetOS);
|
||||||
if FileExistsUTF8(AppendPathDelim(NewTargetDirectory)+NewTargetFilename) then
|
if FileExistsUTF8(AppendPathDelim(NewTargetDirectory)+NewTargetFilename) then
|
||||||
@ -529,7 +534,7 @@ begin
|
|||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
end else begin
|
end else begin
|
||||||
// the lazarus directory is writable
|
// the lazarus directory is writable
|
||||||
if OSLocksExecutables then begin
|
if ExeLocked then begin
|
||||||
// Case 4. the current executable is locked
|
// Case 4. the current executable is locked
|
||||||
// => use a different output name
|
// => use a different output name
|
||||||
NewTargetFilename:='lazarus.new'+GetExecutableExt(NewTargetOS);
|
NewTargetFilename:='lazarus.new'+GetExecutableExt(NewTargetOS);
|
||||||
|
@ -428,18 +428,6 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
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
|
// compile auto install static packages
|
||||||
if not CompileAutoInstallPackages then begin
|
if not CompileAutoInstallPackages then begin
|
||||||
DebugLn('TLazBuildApplication.BuildLazarusIDE: Compile AutoInstall Packages failed.');
|
DebugLn('TLazBuildApplication.BuildLazarusIDE: Compile AutoInstall Packages failed.');
|
||||||
@ -463,7 +451,7 @@ begin
|
|||||||
EnvironmentOptions.ExternalTools,GlobalMacroList,
|
EnvironmentOptions.ExternalTools,GlobalMacroList,
|
||||||
PkgOptions,EnvironmentOptions.CompilerFilename,
|
PkgOptions,EnvironmentOptions.CompilerFilename,
|
||||||
EnvironmentOptions.MakeFilename,
|
EnvironmentOptions.MakeFilename,
|
||||||
Flags+[blfUseMakeIDECfg,blfOnlyIDE]
|
Flags+[blfUseMakeIDECfg,blfOnlyIDE,blfReplaceExe]
|
||||||
);
|
);
|
||||||
if CurResult<>mrOk then begin
|
if CurResult<>mrOk then begin
|
||||||
DebugLn('TLazBuildApplication.BuildLazarusIDE: Building IDE failed.');
|
DebugLn('TLazBuildApplication.BuildLazarusIDE: Building IDE failed.');
|
||||||
|
Loading…
Reference in New Issue
Block a user