'/DNOMINMAX', '/D_CRT_SECURE_NO_WARNINGS',
'/D_VARIADIC_MAX=10',
'/DNINJA_PYTHON="%s"' % options.with_python]
+ if platform.msvc_needs_fs():
+ cflags.append('/FS')
ldflags = ['/DEBUG', '/libpath:$builddir']
if not options.debug:
cflags += ['/Ox', '/DNDEBUG', '/GL']
return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
'mingw', 'msvc', 'gnukfreebsd8', 'bitrig']
-class Platform( object ):
- def __init__( self, platform):
+class Platform(object):
+ def __init__(self, platform):
self._platform = platform
if not self._platform is None:
return
def is_msvc(self):
return self._platform == 'msvc'
+ def msvc_needs_fs(self):
+ import subprocess
+ popen = subprocess.Popen('cl /nologo /?',
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ out, err = popen.communicate()
+ return '/FS ' in out
+
def is_windows(self):
return self.is_mingw() or self.is_msvc()