Parcourir la source

* default namespaces are specified using the new -FN<x> option whereby <x> is the namespace to be added to the
list of default namespaces

git-svn-id: trunk@38919 -

svenbarth il y a 7 ans
Parent
commit
760e1f3776
1 fichiers modifiés avec 19 ajouts et 0 suppressions
  1. 19 0
      compiler/options.pas

+ 19 - 0
compiler/options.pas

@@ -50,6 +50,7 @@ Type
     ParaLibraryPath,
     ParaFrameworkPath,
     parapackagepath : TSearchPathList;
+    paranamespaces : TCmdStrList;
     ParaAlignment   : TAlignmentInfo;
     parapackages : tfphashobjectlist;
     paratarget        : tsystem;
@@ -1591,6 +1592,13 @@ begin
                      else
                        IllegalPara(opt);
                    end;
+                 'N' :
+                   begin
+                     if more<>'' then
+                       paranamespaces.insert(more)
+                     else
+                       illegalpara(opt);
+                   end;
                  'o' :
                    begin
                      if ispara then
@@ -3265,6 +3273,7 @@ begin
   ParaFrameworkPath:=TSearchPathList.Create;
   parapackagepath:=TSearchPathList.Create;
   parapackages:=TFPHashObjectList.Create;
+  paranamespaces:=TCmdStrList.Create;
   FillChar(ParaAlignment,sizeof(ParaAlignment),0);
   MacVersionSet:=false;
   paratarget:=system_none;
@@ -3285,6 +3294,7 @@ begin
   ParaFrameworkPath.Free;
   parapackagepath.Free;
   ParaPackages.Free;
+  paranamespaces.free;
 end;
 
 
@@ -3619,6 +3629,7 @@ var
   i : tfeature;
   j : longint;
   abi : tabi;
+  cmditem: TCmdStrListItem;
 {$if defined(cpucapabilities)}
   cpuflag : tcpuflags;
   hs : string;
@@ -3826,6 +3837,14 @@ begin
   for j:=0 to option.parapackages.count-1 do
     add_package(option.parapackages.NameOfIndex(j),true,true);
 
+  { add default namespaces }
+  cmditem:=TCmdStrListItem(option.paranamespaces.First);
+  while assigned(cmditem) do
+    begin
+      namespacelist.insert(cmditem.Str);
+      cmditem:=TCmdStrListItem(cmditem.Next);
+    end;
+
   { add unit environment and exepath to the unit search path }
   if inputfilepath<>'' then
    Unitsearchpath.AddPath(inputfilepath,true);