(self, config)
return cflags
Returns the flags that need to be added to .c and .cc compilations.
Returns the flags that need to be added to .c and .cc compilations.
Returns the flags that need to be added to . c and . cc compilations .
def GetCflags(self, config):
    """Returns the flags that need to be added to .c and .cc compilations."""
    config = self._TargetConfig(config)
    cflags = []
    cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]])
    cl = self._GetWrapper(self, self.msvs_settings[config],
                          'VCCLCompilerTool', append=cflags)
    cl('Optimization',
       map={'0': 'd', '1': '1', '2': '2', '3': 'x'}, prefix='/O', default='2')
    cl('InlineFunctionExpansion', prefix='/Ob')
    cl('DisableSpecificWarnings', prefix='/wd')
    cl('StringPooling', map={'true': '/GF'})
    cl('EnableFiberSafeOptimizations', map={'true': '/GT'})
    cl('OmitFramePointers', map={'false': '-', 'true': ''}, prefix='/Oy')
    cl('EnableIntrinsicFunctions', map={'false': '-', 'true': ''}, prefix='/Oi')
    cl('FavorSizeOrSpeed', map={'1': 't', '2': 's'}, prefix='/O')
    cl('WholeProgramOptimization', map={'true': '/GL'})
    cl('WarningLevel', prefix='/W')
    cl('WarnAsError', map={'true': '/WX'})
    cl('DebugInformationFormat',
        map={'1': '7', '3': 'i', '4': 'I'}, prefix='/Z')
    cl('RuntimeTypeInfo', map={'true': '/GR', 'false': '/GR-'})
    cl('EnableFunctionLevelLinking', map={'true': '/Gy', 'false': '/Gy-'})
    cl('MinimalRebuild', map={'true': '/Gm'})
    cl('BufferSecurityCheck', map={'true': '/GS', 'false': '/GS-'})
    cl('BasicRuntimeChecks', map={'1': 's', '2': 'u', '3': '1'}, prefix='/RTC')
    cl('RuntimeLibrary',
        map={'0': 'T', '1': 'Td', '2': 'D', '3': 'Dd'}, prefix='/M')
    cl('ExceptionHandling', map={'1': 'sc','2': 'a'}, prefix='/EH')
    cl('DefaultCharIsUnsigned', map={'true': '/J'})
    cl('TreatWChar_tAsBuiltInType',
        map={'false': '-', 'true': ''}, prefix='/Zc:wchar_t')
    cl('EnablePREfast', map={'true': '/analyze'})
    cl('AdditionalOptions', prefix='')
    cflags.extend(['/FI' + f for f in self._Setting(
        ('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])])
    if self.vs_version.short_name in ('2013', '2013e'):
      # New flag required in 2013 to maintain previous PDB behavior.
      cflags.append('/FS')
    # ninja handles parallelism by itself, don't have the compiler do it too.
    cflags = filter(lambda x: not x.startswith('/MP'), cflags)
    return cflags
def GetCflags ( self , config ) : config = self . _TargetConfig ( config ) cflags = [ ] cflags . extend ( [ '/wd' + w for w in self . msvs_disabled_warnings [ config ] ] ) cl = self . _GetWrapper ( self , self . msvs_settings [ config ] , 'VCCLCompilerTool' , append = cflags ) cl ( 'Optimization' , map = { '0' : 'd' , '1' : '1' , '2' : '2' , '3' : 'x' } , prefix = '/O' , default = '2' ) cl ( 'InlineFunctionExpansion' , prefix = '/Ob' ) cl ( 'DisableSpecificWarnings' , prefix = '/wd' ) cl ( 'StringPooling' , map = { 'true' : '/GF' } ) cl ( 'EnableFiberSafeOptimizations' , map = { 'true' : '/GT' } ) cl ( 'OmitFramePointers' , map = { 'false' : '-' , 'true' : '' } , prefix = '/Oy' ) cl ( 'EnableIntrinsicFunctions' , map = { 'false' : '-' , 'true' : '' } , prefix = '/Oi' ) cl ( 'FavorSizeOrSpeed' , map = { '1' : 't' , '2' : 's' } , prefix = '/O' ) cl ( 'WholeProgramOptimization' , map = { 'true' : '/GL' } ) cl ( 'WarningLevel' , prefix = '/W' ) cl ( 'WarnAsError' , map = { 'true' : '/WX' } ) cl ( 'DebugInformationFormat' , map = { '1' : '7' , '3' : 'i' , '4' : 'I' } , prefix = '/Z' ) cl ( 'RuntimeTypeInfo' , map = { 'true' : '/GR' , 'false' : '/GR-' } ) cl ( 'EnableFunctionLevelLinking' , map = { 'true' : '/Gy' , 'false' : '/Gy-' } ) cl ( 'MinimalRebuild' , map = { 'true' : '/Gm' } ) cl ( 'BufferSecurityCheck' , map = { 'true' : '/GS' , 'false' : '/GS-' } ) cl ( 'BasicRuntimeChecks' , map = { '1' : 's' , '2' : 'u' , '3' : '1' } , prefix = '/RTC' ) cl ( 'RuntimeLibrary' , map = { '0' : 'T' , '1' : 'Td' , '2' : 'D' , '3' : 'Dd' } , prefix = '/M' ) cl ( 'ExceptionHandling' , map = { '1' : 'sc' , '2' : 'a' } , prefix = '/EH' ) cl ( 'DefaultCharIsUnsigned' , map = { 'true' : '/J' } ) cl ( 'TreatWChar_tAsBuiltInType' , map = { 'false' : '-' , 'true' : '' } , prefix = '/Zc:wchar_t' ) cl ( 'EnablePREfast' , map = { 'true' : '/analyze' } ) cl ( 'AdditionalOptions' , prefix = '' ) cflags . extend ( [ '/FI' + f for f in self . _Setting ( ( 'VCCLCompilerTool' , 'ForcedIncludeFiles' ) , config , default = [ ] ) ] ) if self . vs_version . short_name in ( '2013' , '2013e' ) : # New flag required in 2013 to maintain previous PDB behavior. cflags . append ( '/FS' ) # ninja handles parallelism by itself, don't have the compiler do it too. cflags = filter ( lambda x : not x . startswith ( '/MP' ) , cflags ) return cflags