Removes uses of GTEST_HAS_STD_STRING.
This commit is contained in:
@@ -88,9 +88,6 @@ class EnvCreator:
|
||||
if env['PLATFORM'] == 'win32':
|
||||
env.Append(CCFLAGS=['/EHsc'])
|
||||
env.Append(CPPDEFINES='_HAS_EXCEPTIONS=1')
|
||||
# Undoes the _TYPEINFO_ hack, which is unnecessary and only creates
|
||||
# trouble when exceptions are enabled.
|
||||
cls._Remove(env, 'CPPDEFINES', '_TYPEINFO_')
|
||||
cls._Remove(env, 'CPPDEFINES', '_HAS_EXCEPTIONS=0')
|
||||
else:
|
||||
env.Append(CCFLAGS='-fexceptions')
|
||||
|
||||
@@ -50,8 +50,12 @@ sconstruct_helper.Initialize(build_root_path='..',
|
||||
|
||||
win_base = sconstruct_helper.MakeWinBaseEnvironment()
|
||||
|
||||
# We don't support VC 7.1 with exceptions disabled, so we always
|
||||
# enable exceptions for VC 7.1. For newer versions of VC, we still
|
||||
# compile with exceptions disabled by default, as that's a more common
|
||||
# setting for our users.
|
||||
if win_base.get('MSVS_VERSION', None) == '7.1':
|
||||
sconstruct_helper.AllowVc71StlWithoutExceptions(win_base)
|
||||
sconstruct_helper.EnableExceptions(win_base)
|
||||
|
||||
sconstruct_helper.MakeWinDebugEnvironment(win_base, 'win-dbg')
|
||||
sconstruct_helper.MakeWinOptimizedEnvironment(win_base, 'win-opt')
|
||||
|
||||
@@ -45,6 +45,13 @@ class SConstructHelper:
|
||||
# A dictionary to look up an environment by its name.
|
||||
self.env_dict = {}
|
||||
|
||||
def _Remove(self, env, attribute, value):
|
||||
"""Removes the given attribute value from the environment."""
|
||||
|
||||
attribute_values = env[attribute]
|
||||
if value in attribute_values:
|
||||
attribute_values.remove(value)
|
||||
|
||||
def Initialize(self, build_root_path, support_multiple_win_builds=False):
|
||||
test_env = Environment()
|
||||
platform = test_env['PLATFORM']
|
||||
@@ -83,13 +90,14 @@ class SConstructHelper:
|
||||
# Enable scons -h
|
||||
Help(vars.GenerateHelpText(self.env_base))
|
||||
|
||||
def AllowVc71StlWithoutExceptions(self, env):
|
||||
env.Append(
|
||||
CPPDEFINES = [# needed for using some parts of STL with exception
|
||||
# disabled. The scoop is given here, with comments
|
||||
# from P.J. Plauger at
|
||||
# http://groups.google.com/group/microsoft.public.vc.stl/browse_thread/thread/5e719833c6bdb177?q=_HAS_EXCEPTIONS+using+namespace+std&pli=1
|
||||
'_TYPEINFO_'])
|
||||
def EnableExceptions(self, env):
|
||||
if env['PLATFORM'] == 'win32':
|
||||
env.Append(CCFLAGS=['/EHsc'])
|
||||
env.Append(CPPDEFINES='_HAS_EXCEPTIONS=1')
|
||||
self._Remove(env, 'CPPDEFINES', '_HAS_EXCEPTIONS=0')
|
||||
else:
|
||||
env.Append(CCFLAGS='-fexceptions')
|
||||
self._Remove(env, 'CCFLAGS', '-fno-exceptions')
|
||||
|
||||
def MakeWinBaseEnvironment(self):
|
||||
win_base = self.env_base.Clone(
|
||||
@@ -117,7 +125,6 @@ class SConstructHelper:
|
||||
'STRICT',
|
||||
'WIN32_LEAN_AND_MEAN',
|
||||
'_HAS_EXCEPTIONS=0',
|
||||
'GTEST_ALLOW_VC71_WITHOUT_EXCEPTIONS_=1',
|
||||
],
|
||||
LIBPATH=['#/$MAIN_DIR/lib'],
|
||||
LINKFLAGS=['-MACHINE:x86', # Enable safe SEH (not supp. on x64)
|
||||
|
||||
Reference in New Issue
Block a user