From c89970ffba1478ff3f7737550e288505c160b6c9 Mon Sep 17 00:00:00 2001 From: juha Date: Fri, 19 Nov 2010 13:23:32 +0000 Subject: [PATCH] IDE: allow running a library when a host application is defined in run parameters. git-svn-id: trunk@28347 - --- ide/debugmanager.pas | 8 +++++--- ide/main.pp | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas index effb8d12c1..6048014559 100644 --- a/ide/debugmanager.pas +++ b/ide/debugmanager.pas @@ -2190,9 +2190,11 @@ begin // For 'run' and 'step' bypass 'idle', so we can set the filename later CanRun:=false; if Project1<>nil then - CanRun:=((AnUnitInfo<>nil) and (AnUnitInfo.RunFileIfActive)) or - ((Project1.CompilerOptions.ExecutableType=cetProgram) - and (pfRunnable in Project1.Flags)); + CanRun:=( (AnUnitInfo<>nil) and (AnUnitInfo.RunFileIfActive) ) or + ( ((Project1.CompilerOptions.ExecutableType=cetProgram) or + (Project1.RunParameterOptions.HostApplicationFilename<>'')) + and (pfRunnable in Project1.Flags) + ); RunSpeedButton.Enabled := CanRun and (DebuggerInvalid or (dcRun in FDebugger.Commands) or (FDebugger.State = dsIdle)); itmRunMenuRun.Enabled := RunSpeedButton.Enabled; diff --git a/ide/main.pp b/ide/main.pp index 1233453085..f1336a40ae 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -11097,8 +11097,9 @@ begin // Check if we can run this project debugln('TMainIDE.DoInitProjectRun A ',dbgs(pfRunnable in Project1.Flags),' ',dbgs(Project1.MainUnitID)); - if not ((Project1.CompilerOptions.ExecutableType=cetProgram) and - (pfRunnable in Project1.Flags) and (Project1.MainUnitID >= 0)) then Exit; + if not ( ((Project1.CompilerOptions.ExecutableType=cetProgram) or + (Project1.RunParameterOptions.HostApplicationFilename<>'')) + and (pfRunnable in Project1.Flags) and (Project1.MainUnitID >= 0) ) then Exit; debugln('TMainIDE.DoInitProjectRun B'); // Build project first