@@ -124,6 +124,8 @@ def check_include_file(include_dirs, filename, package):
124
124
"""
125
125
Raises an exception if the given include file can not be found.
126
126
"""
127
+ if sys .platform == 'win32' :
128
+ include_dirs .extend (os .getenv ('INCLUDE' , '.' ).split (';' ))
127
129
if not has_include_file (include_dirs , filename ):
128
130
raise CheckFailed (
129
131
"The C/C++ header for %s (%s) could not be found. You "
@@ -1295,32 +1297,32 @@ def get_extension(self):
1295
1297
1296
1298
def add_flags (self , ext ):
1297
1299
if sys .platform == 'win32' :
1298
- # popen broken on my win32 plaform so I can't use pkgconfig
1299
- ext .library_dirs .extend (
1300
- ['C:/GTK/bin' , 'C:/GTK/lib' ])
1301
-
1302
- ext .include_dirs .extend (
1303
- ['win32_static/include/pygtk-2.0' ,
1304
- 'C:/GTK/include' ,
1305
- 'C:/GTK/include/gobject' ,
1306
- 'C:/GTK/include/gext' ,
1307
- 'C:/GTK/include/glib' ,
1308
- 'C:/GTK/include/pango' ,
1309
- 'C:/GTK/include/atk' ,
1310
- 'C:/GTK/include/X11' ,
1311
- 'C:/GTK/include/cairo' ,
1312
- 'C:/GTK/include/gdk' ,
1313
- 'C:/GTK/include/gdk-pixbuf' ,
1314
- 'C:/GTK/include/gtk' ,
1315
- ])
1316
-
1317
1300
def getoutput (s ):
1318
1301
ret = os .popen (s ).read ().strip ()
1319
1302
return ret
1320
1303
1321
1304
if 'PKG_CONFIG_PATH' not in os .environ :
1322
1305
# If Gtk+ is installed, pkg-config is required to be installed
1323
- os .environ ['PKG_CONFIG_PATH' ] = 'C:\GTK\lib\pkgconfig'
1306
+ os .environ ['PKG_CONFIG_PATH' ] = 'C:\\ GTK\\ lib\\ pkgconfig'
1307
+
1308
+ # popen broken on my win32 plaform so I can't use pkgconfig
1309
+ ext .library_dirs .extend (
1310
+ ['C:/GTK/bin' , 'C:/GTK/lib' ])
1311
+
1312
+ ext .include_dirs .extend (
1313
+ ['win32_static/include/pygtk-2.0' ,
1314
+ 'C:/GTK/include' ,
1315
+ 'C:/GTK/include/gobject' ,
1316
+ 'C:/GTK/include/gext' ,
1317
+ 'C:/GTK/include/glib' ,
1318
+ 'C:/GTK/include/pango' ,
1319
+ 'C:/GTK/include/atk' ,
1320
+ 'C:/GTK/include/X11' ,
1321
+ 'C:/GTK/include/cairo' ,
1322
+ 'C:/GTK/include/gdk' ,
1323
+ 'C:/GTK/include/gdk-pixbuf' ,
1324
+ 'C:/GTK/include/gtk' ,
1325
+ ])
1324
1326
1325
1327
pygtkIncludes = getoutput (
1326
1328
'pkg-config --cflags-only-I pygtk-2.0' ).split ()
0 commit comments