mirror of https://gitlab.com/basile.b/dexed.git
fix, cwd problem that afected pre/post comp process
This commit is contained in:
parent
f9fecb8069
commit
6ef2178d3e
|
@ -659,10 +659,9 @@ begin
|
||||||
process.Parameters.AddText(symbolExpander.get(process.Parameters.Strings[i]));
|
process.Parameters.AddText(symbolExpander.get(process.Parameters.Strings[i]));
|
||||||
for i:= 0 to j do
|
for i:= 0 to j do
|
||||||
process.Parameters.Delete(0);
|
process.Parameters.Delete(0);
|
||||||
if process.CurrentDirectory = '' then
|
if process.CurrentDirectory <> '' then
|
||||||
process.CurrentDirectory := extractFilePath(process.Executable)
|
|
||||||
else
|
|
||||||
process.CurrentDirectory := symbolExpander.get(process.CurrentDirectory);
|
process.CurrentDirectory := symbolExpander.get(process.CurrentDirectory);
|
||||||
|
// else cwd is set to project dir in compile()
|
||||||
ensureNoPipeIfWait(process);
|
ensureNoPipeIfWait(process);
|
||||||
process.Execute;
|
process.Execute;
|
||||||
while process.Running do
|
while process.Running do
|
||||||
|
@ -695,16 +694,21 @@ begin
|
||||||
msgs.clearByData(self as ICECommonProject);
|
msgs.clearByData(self as ICECommonProject);
|
||||||
subjProjCompiling(fProjectSubject, Self);
|
subjProjCompiling(fProjectSubject, Self);
|
||||||
//
|
//
|
||||||
|
prjpath := extractFilePath(fFileName);
|
||||||
|
oldCwd := GetCurrentDir;
|
||||||
|
SetCurrentDir(prjpath);
|
||||||
|
//
|
||||||
if not runPrePostProcess(config.preBuildProcess) then
|
if not runPrePostProcess(config.preBuildProcess) then
|
||||||
msgs.message('project warning: the pre-compilation process has not been properly executed',
|
msgs.message('project warning: the pre-compilation process has not been properly executed',
|
||||||
self as ICECommonProject, amcProj, amkWarn);
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
SetCurrentDir(prjpath);
|
||||||
//
|
//
|
||||||
if (Sources.Count = 0) and (config.pathsOptions.extraSources.Count = 0) then
|
if (Sources.Count = 0) and (config.pathsOptions.extraSources.Count = 0) then
|
||||||
|
begin
|
||||||
|
SetCurrentDir(oldCwd);
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
//
|
//
|
||||||
prjpath := extractFilePath(fFileName);
|
|
||||||
oldCwd := GetCurrentDir;
|
|
||||||
ChDir(prjpath);
|
|
||||||
prjname := shortenPath(filename, 25);
|
prjname := shortenPath(filename, 25);
|
||||||
compilproc := TProcess.Create(nil);
|
compilproc := TProcess.Create(nil);
|
||||||
try
|
try
|
||||||
|
@ -724,16 +728,16 @@ begin
|
||||||
result := true;
|
result := true;
|
||||||
end else
|
end else
|
||||||
msgs.message(prjname + ' has not been compiled', self as ICECommonProject, amcProj, amkWarn);
|
msgs.message(prjname + ' has not been compiled', self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
|
||||||
if not runPrePostProcess(config.PostBuildProcess) then
|
|
||||||
msgs.message( 'project warning: the post-compilation process has not been properly executed',
|
|
||||||
self as ICECommonProject, amcProj, amkWarn);
|
|
||||||
|
|
||||||
finally
|
finally
|
||||||
updateOutFilename;
|
updateOutFilename;
|
||||||
compilproc.Free;
|
compilproc.Free;
|
||||||
ChDir(oldCwd);
|
|
||||||
end;
|
end;
|
||||||
|
SetCurrentDir(prjpath);
|
||||||
|
//
|
||||||
|
if not runPrePostProcess(config.PostBuildProcess) then
|
||||||
|
msgs.message( 'project warning: the post-compilation process has not been properly executed',
|
||||||
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
SetCurrentDir(oldCwd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCENativeProject.run(const runArgs: string = ''): Boolean;
|
function TCENativeProject.run(const runArgs: string = ''): Boolean;
|
||||||
|
|
Loading…
Reference in New Issue