mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 11:49:41 +02:00
codetools: fixed CreateRelativePath
git-svn-id: trunk@28994 -
This commit is contained in:
parent
ca536d0252
commit
4b32b87dde
components/codetools
ide
lcl/include
packager
@ -1464,10 +1464,12 @@ begin
|
||||
if ((BaseDirPos>BaseDirLen) or (CmpBaseDirectory[BaseDirPos]=PathDelim))
|
||||
and ((p>FileNameLength) or (CmpFilename[p]=PathDelim)) then
|
||||
begin
|
||||
// for example File=/a BaseDir=/a/b
|
||||
inc(DirCount);
|
||||
inc(BaseDirPos);
|
||||
end else
|
||||
end else begin
|
||||
// for example File=/aa BaseDir=/ab
|
||||
inc(UpDirCount);
|
||||
end;
|
||||
if DirCount=0 then exit;
|
||||
if FilenameIsAbsolute(BaseDirectory) and (DirCount=1) then exit;
|
||||
|
||||
|
@ -2027,33 +2027,33 @@ var
|
||||
begin
|
||||
// current path
|
||||
CurrentPath:=ParsedOpts.GetParsedPIValue(Option);
|
||||
{$IFDEF VerbosePkgUnitPath}
|
||||
{ $IFDEF VerbosePkgUnitPath}
|
||||
if Option=pcosUnitPath then
|
||||
debugln('TBaseCompilerOptions.GetParsedPIPath GetParsedPIValue ',dbgsName(Self),' RelativeToBaseDir=',dbgs(RelativeToBaseDir),' CurrentPath="',CurrentPath,'" BaseDirectory="',BaseDirectory,'"');
|
||||
{$ENDIF}
|
||||
{ $ENDIF}
|
||||
|
||||
if RelativeToBaseDir then
|
||||
CurrentPath:=CreateRelativeSearchPath(CurrentPath,BaseDirectory)
|
||||
else
|
||||
CurrentPath:=CreateAbsoluteSearchPath(CurrentPath,BaseDirectory);
|
||||
{$IFDEF VerbosePkgUnitPath}
|
||||
{ $IFDEF VerbosePkgUnitPath}
|
||||
if Option=pcosUnitPath then
|
||||
debugln('TBaseCompilerOptions.GetParsedPIPath Abs/Rel ',dbgsName(Self),' CurrentPath="',CurrentPath,'"');
|
||||
{$ENDIF}
|
||||
{ $ENDIF}
|
||||
|
||||
// inherited path
|
||||
InheritedPath:=GetInheritedOption(InheritedOption,RelativeToBaseDir,
|
||||
coptParsedPlatformIndependent);
|
||||
{$IFDEF VerbosePkgUnitPath}
|
||||
{ $IFDEF VerbosePkgUnitPath}
|
||||
if Option=pcosUnitPath then
|
||||
debugln('TBaseCompilerOptions.GetParsedPIPath Inherited ',dbgsName(Self),' InheritedPath="',InheritedPath,'"');
|
||||
{$ENDIF}
|
||||
{ $ENDIF}
|
||||
|
||||
Result:=MergeSearchPaths(CurrentPath,InheritedPath);
|
||||
{$IFDEF VerbosePkgUnitPath}
|
||||
{ $IFDEF VerbosePkgUnitPath}
|
||||
if Option=pcosUnitPath then
|
||||
debugln('TBaseCompilerOptions.GetParsedPIPath Total ',dbgsName(Self),' Result="',Result,'"');
|
||||
{$ENDIF}
|
||||
{ $ENDIF}
|
||||
end;
|
||||
|
||||
function TBaseCompilerOptions.GetUnparsedPath(Option: TParsedCompilerOptString;
|
||||
|
@ -873,10 +873,12 @@ begin
|
||||
if ((BaseDirPos>BaseDirLen) or (CmpBaseDirectory[BaseDirPos]=PathDelim))
|
||||
and ((p>FileNameLength) or (CmpFilename[p]=PathDelim)) then
|
||||
begin
|
||||
// for example File=/a BaseDir=/a/b
|
||||
inc(DirCount);
|
||||
inc(BaseDirPos);
|
||||
end else
|
||||
end else begin
|
||||
// for example File=/aa BaseDir=/ab
|
||||
inc(UpDirCount);
|
||||
end;
|
||||
if DirCount=0 then exit;
|
||||
if FilenameIsAbsolute(BaseDirectory) and (DirCount=1) then exit;
|
||||
|
||||
|
@ -3670,6 +3670,7 @@ begin
|
||||
MainUnitName:=lowercase(ExtractFileNameOnly((SrcFilename)));
|
||||
UnitPath:=APackage.CompilerOptions.GetUnitPath(true,
|
||||
coptParsedPlatformIndependent);
|
||||
debugln(['TLazPackageGraph.WriteMakeFile UnitPath="',UnitPath,'" ']);
|
||||
IncPath:=APackage.CompilerOptions.GetIncludePath(true,
|
||||
coptParsedPlatformIndependent,false);
|
||||
UnitOutputPath:=APackage.CompilerOptions.GetUnitOutPath(true,
|
||||
|
Loading…
Reference in New Issue
Block a user