+ fix #40963: print suitable messages for local unit, include, library and object paths if -vt is given

+ added test
This commit is contained in:
Sven/Sarah Barth 2024-10-25 17:13:23 +02:00
parent 3e8e02bede
commit 00fc962ca3
3 changed files with 48 additions and 4 deletions

View File

@ -54,7 +54,7 @@
#
# General
#
# 01027 is the last used one
# 01033 is the last used one
#
# BeginOfTeX
% \section{General compiler messages}
@ -148,6 +148,22 @@ general_i_reduced_filesearch=01028_I_Reduced file search: Not searching for uppe
% will not look for uppercased filenames or 8.3 conforming filenames.
general_f_compiler_aborted=01029_F_Compiler stopped
% Compilation was aborted.
general_t_unitpath_local=01030_T_$1: Using local unit path: $2
% When the \var{-vt} switch is used, this line tells you where the compiler
% looks for compiled units. You can set this path with the \var{\{\$UNITPATH xxx\}}
% directive.
general_t_includepath_local=01031_T_$1: Using local include path: $2
% When the \var{-vt} switch is used, this line tells you where the compiler
% looks for its include files (files used in \var{\{\$I xxx\}} statements).
% You can set this path with the \var{\{\$INCLUDEPATH xxx\}} directive.
general_t_librarypath_local=01032_T_$1: Using local library path: $2
% When the \var{-vt} switch is used, this line tells you where the compiler
% looks for the libraries. You can set this path with the \var{\{\$LIBRARYPATH xxx\}}
% directive.
general_t_objectpath_local=01033_T_$1: Using local object path: $2
% When the \var{-vt} switch is used, this line tells you where the compiler
% looks for object files you link in (files used in \var{\{\$L xxx\}} statements).
% You can set this path with the \var{\{\$OBJECTPATH xxx\}} directive.
% \end{description}
#
# Scanner

View File

@ -615,13 +615,17 @@ unit scandir;
end;
procedure dir_includepath;
var
path : string;
begin
if not current_module.in_global then
Message(scan_w_switch_is_global)
else
begin
current_scanner.skipspace;
current_module.localincludesearchpath.AddPath(current_scanner.readcomment,false);
path:=current_scanner.readcomment;
current_module.localincludesearchpath.AddPath(path,false);
Message2(general_t_includepath_local,current_module.realmodulename^,path);
end;
end;
@ -666,13 +670,17 @@ unit scandir;
end;
procedure dir_librarypath;
var
path : string;
begin
if not current_module.in_global then
Message(scan_w_switch_is_global)
else
begin
current_scanner.skipspace;
current_module.locallibrarysearchpath.AddPath(current_scanner.readcomment,false);
path:=current_scanner.readcomment;
current_module.locallibrarysearchpath.AddPath(path,false);
Message2(general_t_librarypath_local,current_module.realmodulename^,path);
end;
end;
@ -1095,13 +1103,17 @@ unit scandir;
end;
procedure dir_objectpath;
var
path : string;
begin
if not current_module.in_global then
Message(scan_w_switch_is_global)
else
begin
current_scanner.skipspace;
current_module.localobjectsearchpath.AddPath(current_scanner.readcomment,false);
path:=current_scanner.readcomment;
current_module.localobjectsearchpath.AddPath(path,false);
Message2(general_t_objectpath_local,current_module.realmodulename^,path);
end;
end;
@ -1670,6 +1682,7 @@ unit scandir;
not path_absolute(unitpath) then
unitpath:=current_module.path+source_info.DirSep+unitpath;
current_module.localunitsearchpath.AddPath(unitpath,false);
Message2(general_t_unitpath_local,current_module.realmodulename^,unitpath);
end;
end;

15
tests/webtbs/tw40963.pp Normal file
View File

@ -0,0 +1,15 @@
{ %EXPECTMSGS=1030,1031,1032,1033 }
{ %OPT=-vt }
unit tw40963;
interface
{$UNITPATH test}
{$INCLUDEPATH test}
{$LIBRARYPATH test}
{$OBJECTPATH test}
implementation
end.