@@ -76,15 +76,15 @@ TMSBuildCompiler = class(TInterfacedObject, ICompiler)
7676 procedure SetVerbosity (const value : TCompilerVerbosity);
7777
7878
79- function GetPlatformName : string;
79+ // function GetPlatformName : string;
8080 function GetProjectSearchPath (const configName : string) : string;
8181
8282 function GetCompilerOutput : TStrings;
8383
8484 function GetMSBuildParameters (const configName : string; const packageVersion : TPackageVersion) : string;
85- function GetCommandLine (const projectFile : string; const configName : string; const packageVersion : TPackageVersion) : string;
85+ function GetCommandLine (const platform : TDPMPlatform; const projectFile : string; const configName : string; const packageVersion : TPackageVersion) : string;
8686
87- function BuildProject (const cancellationToken : ICancellationToken; const projectFile : string; const configName : string; const packageVersion : TPackageVersion; const forDesign : boolean) : Boolean;
87+ function BuildProject (const cancellationToken : ICancellationToken; const platform : TDPMPlatform; const projectFile : string; const configName : string; const packageVersion : TPackageVersion; const forDesign : boolean) : Boolean;
8888 public
8989 constructor Create(const logger : ILogger; const compilerVersion : TCompilerVersion; const platform : TDPMPlatform; const env : ICompilerEnvironmentProvider);
9090 destructor Destroy; override;
@@ -98,17 +98,19 @@ implementation
9898 System.IOUtils,
9999 DPM.Core.Utils.Path,
100100 DPM.Core.Utils.Process,
101+ DPM.Core.Utils.System,
101102 DPM.Core.Compiler.ProjectSettings;
102103
103104
104105{ TMSBuildCompiler }
105106
106- function TMSBuildCompiler.BuildProject (const cancellationToken : ICancellationToken; const projectFile : string; const configName : string; const packageVersion : TPackageVersion; const forDesign : boolean) : Boolean;
107+ function TMSBuildCompiler.BuildProject (const cancellationToken : ICancellationToken; const platform : TDPMPlatform; const projectFile : string; const configName : string; const packageVersion : TPackageVersion; const forDesign : boolean) : Boolean;
107108var
108109 commandLine : string;
109110 env : IEnvironmentBlock;
110111 i : integer;
111112begin
113+
112114 result := false;
113115 FBuildForDesign := forDesign;
114116 FCompilerOutput.Clear;
@@ -117,7 +119,7 @@ function TMSBuildCompiler.BuildProject(const cancellationToken : ICancellationTo
117119 FProjectFile := projectFile;
118120
119121 try
120- commandLine := GetCommandLine(projectFile, configName, packageVersion);
122+ commandLine := GetCommandLine(platform, projectFile, configName, packageVersion);
121123 except
122124 on e : Exception do
123125 begin
@@ -189,11 +191,11 @@ function TMSBuildCompiler.GetBPLOutput : string;
189191 result := FBPLOutput;
190192end ;
191193
192- function TMSBuildCompiler.GetCommandLine (const projectFile, configName : string; const packageVersion : TPackageVersion) : string;
194+ function TMSBuildCompiler.GetCommandLine (const platform : TDPMPlatform; const projectFile, configName : string; const packageVersion : TPackageVersion) : string;
193195begin
194196 // I don't like this... but it will do for a start.
195197
196- result := ' call "' + FEnv.GetRsVarsFilePath(FCompilerVersion) + ' "' ;
198+ result := ' call "' + FEnv.GetRsVarsFilePath(platform, FCompilerVersion) + ' "' ;
197199 result := result + ' & msbuild "' + projectfile + ' " ' + GetMSBuildParameters(configName, packageVersion);
198200 result := ' cmd /c ' + result + ' > ' + FCompilerLogFile;
199201end ;
@@ -224,7 +226,7 @@ function TMSBuildCompiler.GetMSBuildParameters(const configName : string; const
224226 // We should investigate updating the dproj.
225227 result := ' /target:BuildVersionResource;Build' ;
226228 result := result + ' /p:Config=' + configName;
227- if FBuildForDesign then
229+ if FBuildForDesign and ( not TSystemUtils.Is64bitIDE) then
228230 result := result + ' /p:Platform=' + DPMPlatformToBDString(TDPMPlatform.Win32)
229231 else
230232 result := result + ' /p:Platform=' + DPMPlatformToBDString(FPlatform);
@@ -275,13 +277,15 @@ function TMSBuildCompiler.GetPlatform : TDPMPlatform;
275277 result := FPlatform;
276278end ;
277279
278- function TMSBuildCompiler.GetPlatformName : string;
279- begin
280- if FBuildForDesign then
281- result := DPMPlatformToBDString(TDPMPlatform.Win32)
282- else
283- result := DPMPlatformToBDString(FPlatform);
284- end ;
280+ // function TMSBuildCompiler.GetPlatformName: string;
281+ // begin
282+ // if FBuildForDesign then
283+ // begin
284+ // result := DPMPlatformToBDString(TDPMPlatform.Win32)
285+ // end
286+ // else
287+ // result := DPMPlatformToBDString(FPlatform);
288+ // end;
285289
286290function TMSBuildCompiler.GetProjectSearchPath (const configName: string): string;
287291var
@@ -301,12 +305,20 @@ function TMSBuildCompiler.GetProjectSearchPath(const configName: string): string
301305 end ;
302306
303307 if FBuildForDesign then
304- platform := TDPMPlatform.Win32
308+ begin
309+ if TSystemUtils.Is64BitIDE then
310+ platform := TDPMPlatform.Win64
311+ else
312+ platform := TDPMPlatform.Win32
313+ end
305314 else
306315 platform := FPlatform;
307316
308- settingsLoader := TDPMProjectSettingsLoader.Create(FProjectFile, configName, platform);
317+ FLogger.Debug(' Loading project to get search path : ' + FProjectFile);
318+ settingsLoader := TDPMProjectSettingsLoader.Create(FLogger, FProjectFile, configName, platform);
309319 s := settingsLoader.GetSearchPath;
320+ FLogger.Debug(' Project Search Path : ' + s);
321+
310322 if s <> ' ' then
311323 result := s + ' ;' + result;
312324
0 commit comments