Browse Source

interrogate barfs on platform-sdk dir, hack around by filtering out that dir

cxgeorge 24 years ago
parent
commit
f85ede6104

+ 3 - 1
dtool/Config.Win32.pp

@@ -6,8 +6,10 @@
 // compiler features, etc.
 //
 
+// -D__stdcall seems dangerous, interrogate will assume c-calling convention for WINAPI fns
+
 // What additional flags should we pass to interrogate?
-#define SYSTEM_IGATE_FLAGS -longlong __int64 -D_X86_ -DWIN32_VC -D"_declspec(param)="
+#define SYSTEM_IGATE_FLAGS -longlong __int64 -D_X86_ -DWIN32_VC -D"_declspec(param)=" -D_near  -D_far -D__near  -D__far
 
 // Is the platform big-endian (like an SGI workstation) or
 // little-endian (like a PC)?  Define this to the empty string to

+ 2 - 7
dtool/pptempl/Global.pp

@@ -437,10 +437,6 @@
 #defun get_ipath
   #define alt_ipath $[stl_ipath] $[nspr_ipath] $[python_ipath]
   
-  #if $[eq $[PLATFORM],Win32]  
-    // all win32 files need path to latest windows.h and libs, which are in plat-sdk dirs, not the deflt vc ones
-    #set alt_ipath $[WIN32_PLATFORMSDK_INCPATH] $[alt_ipath]
-  #endif  
   #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
     #set alt_ipath $[alt_ipath] $[crypto_ipath]
   #endif
@@ -745,13 +741,12 @@ Warning: Variable $[upcase $[tree]]_INSTALL is not set!
   #define install_parser_inc_dir $[install_headers_dir]/parser-inc
 #endif
 
-
 // Set up the correct interrogate options.
 #defer interrogate_ipath $[target_ipath:%=-I%]
 #defer interrogate_spath $[install_parser_inc_dir:%=-S%]
-#defer interrogate_options \
+#defer interrogate_options $[interrogate_ipath] \
     -DCPPPARSER -D__cplusplus $[SYSTEM_IGATE_FLAGS] \
-    $[interrogate_spath] $[interrogate_ipath] \
+    $[interrogate_spath] \
     $[CDEFINES_OPT$[OPTIMIZE]:%=-D%] \
     $[filter -D%,$[C++FLAGS]] \
     $[INTERROGATE_OPTIONS] \

+ 8 - 2
dtool/pptempl/Template.gmsvc.pp

@@ -144,7 +144,9 @@
 
 // $[target_ipath] is the proper ipath to put on the command line,
 // from the context of a particular target.
-#defer target_ipath $[TOPDIR] $[sort $[complete_ipath]] $[other_trees:%=%/include] $[get_ipath]
+
+// platsdk must be on end since it has filename collisions with panda stuff (buffer.h)
+#defer target_ipath $[TOPDIR] $[sort $[complete_ipath]] $[other_trees:%=%\include] $[get_ipath] $[WIN32_PLATFORMSDK_INCPATH] 
 
 // $[file_ipath] is the ipath from the context of a particular source
 // file, given in $[file].  It uses the all_sources map to look up
@@ -490,9 +492,12 @@ $[TAB] cp -f $[so_dir]/$[local] $[dest]
 // parallel make.
 $[so_dir]/$[igatedb] : $[so_dir]/$[igateoutput]
 
+// have to filter out plat-sdk inc dir, since interrogate is currently too buggy to parse stuff there
+#define filtered_interrogate_options $[filter-out -I"C:\Program Files\Microsoft Platform Sdk\Include", $[interrogate_options]]
+
 lib$[TARGET]_igatescan = $[igatescan]
 $[so_dir]/$[igateoutput] : $[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]] $[so_dir]/stamp
-$[TAB] interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan)
+$[TAB] interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[filtered_interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan)
 
 #define target $[igateoutput:%.cxx=$[so_dir]/%.obj]
 #define source $[so_dir]/$[igateoutput]
@@ -513,6 +518,7 @@ $[TAB] $[COMPILE_C++]
 lib$[TARGET]_igatemscan = $[igatemscan]
 #define target $[so_dir]/$[igatemout]
 #define sources $(lib$[TARGET]_igatemscan)
+
 $[target] : $[sources] $[so_dir]/stamp
 $[TAB] interrogate_module -oc $[target] -module "$[igatemod]" -library "$[igatelib]" $[interrogate_module_options] $[sources]
 

+ 5 - 2
dtool/pptempl/Template.msvc.pp

@@ -150,7 +150,8 @@
 
 // $[target_ipath] is the proper ipath to put on the command line,
 // from the context of a particular target.
-#defer target_ipath $[TOPDIR] $[sort $[complete_ipath]] $[other_trees:%=%\include] $[get_ipath]
+// (Note: platform sdk must be on end since it has filename collisions with panda stuff (buffer.h))
+#defer target_ipath $[TOPDIR] $[sort $[complete_ipath]] $[other_trees:%=%\include] $[get_ipath] $[WIN32_PLATFORMSDK_INCPATH] 
 
 // $[file_ipath] is the ipath from the context of a particular source
 // file, given in $[file].  It uses the all_sources map to look up
@@ -458,12 +459,14 @@ $[TAB] $[NT_COPYCMD] $[so_dir]\$[local] $[dest]
 $[install_igatedb_dir]\$[igatedb] : $[so_dir]\$[igatedb]
 #define local $[igatedb]
 #define dest $[install_igatedb_dir]
+// have to filter out plat-sdk inc dir, since interrogate is currently too buggy to parse stuff there
+#define filtered_interrogate_options $[filter-out -I"C:\Program Files\Microsoft Platform Sdk\Include", $[interrogate_options]]
 $[TAB] $[NT_COPYCMD] $[so_dir]\$[local] $[dest]
 
 lib$[TARGET]_igatescan = $[osfilename $[igatescan]]
 $[so_dir]\$[igatedb] $[so_dir]\$[igateoutput] : $[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]]
 // We use forward slash for interrogate because it prefers those.
-$[TAB] interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan)
+$[TAB] interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[filtered_interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan)
 
 #define target $[igateoutput:%.cxx=$[so_dir]\%.obj]
 #define source $[so_dir]\$[igateoutput]