Răsfoiți Sursa

* search preprocessor binary and add it as command line parameter for windres, so that the cpp doesn't need to be on the path

git-svn-id: trunk@8670 -
Vincent Snijders 18 ani în urmă
părinte
comite
bc7e54c3f0
1 a modificat fișierele cu 10 adăugiri și 3 ștergeri
  1. 10 3
      compiler/comprsrc.pas

+ 10 - 3
compiler/comprsrc.pas

@@ -114,6 +114,7 @@ procedure tresourcefile.compile(output: tresoutput; const OutName: ansistring);
 var
   respath,
   srcfilepath,
+  preprocessorbin,
   s,
   bin,
   resbin   : TCmdStr;
@@ -157,9 +158,15 @@ begin
   if respath='' then
     respath:='.';
   Replace(s,'$INC',maybequoted(respath));
-  if (target_res.resbin='windres') and
-     (srcfilepath<>'') then
-    s:=s+' --include '+maybequoted(srcfilepath);
+  if (target_res.resbin='windres') then
+   begin
+     if (srcfilepath<>'') then
+       s:=s+' --include '+maybequoted(srcfilepath);
+     { try to find a preprocessor }
+     preprocessorbin := respath+'cpp'+source_info.exeext;
+     if FileExists(preprocessorbin,true) then
+       s:=s+' --preprocessor='+preprocessorbin;
+   end;
 { Execute the command }
   if not (cs_link_nolink in current_settings.globalswitches) then
    begin