parameters: (default_variables, params)
docstring: Calculate additional variables for use in the build (called by gyp).
docstring_summary: Calculate additional variables for use in the build (called by gyp).
docstring_tokens: Calculate additional variables for use in the build ( called by gyp ) .
function: def CalculateVariables(default_variables, params):
    """Calculate additional variables for use in the build (called by gyp)."""
    global generator_additional_non_configuration_keys
    global generator_additional_path_sections
    flavor = gyp.common.GetFlavor(params)
    if flavor == 'mac':
      default_variables.setdefault('OS', 'mac')
      default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')
      default_variables.setdefault('SHARED_LIB_DIR',
                                   generator_default_variables['PRODUCT_DIR'])
      default_variables.setdefault('LIB_DIR',
                                   generator_default_variables['PRODUCT_DIR'])
  
      # Copy additional generator configuration data from Xcode, which is shared
      # by the Mac Ninja generator.
      import gyp.generator.xcode as xcode_generator
      generator_additional_non_configuration_keys = getattr(xcode_generator,
          'generator_additional_non_configuration_keys', [])
      generator_additional_path_sections = getattr(xcode_generator,
          'generator_additional_path_sections', [])
      global generator_extra_sources_for_rules
      generator_extra_sources_for_rules = getattr(xcode_generator,
          'generator_extra_sources_for_rules', [])
    elif flavor == 'win':
      default_variables.setdefault('OS', 'win')
      default_variables['EXECUTABLE_SUFFIX'] = '.exe'
      default_variables['STATIC_LIB_PREFIX'] = ''
      default_variables['STATIC_LIB_SUFFIX'] = '.lib'
      default_variables['SHARED_LIB_PREFIX'] = ''
      default_variables['SHARED_LIB_SUFFIX'] = '.dll'
  
      # Copy additional generator configuration data from VS, which is shared
      # by the Windows Ninja generator.
      import gyp.generator.msvs as msvs_generator
      generator_additional_non_configuration_keys = getattr(msvs_generator,
          'generator_additional_non_configuration_keys', [])
      generator_additional_path_sections = getattr(msvs_generator,
          'generator_additional_path_sections', [])
  
      gyp.msvs_emulation.CalculateCommonVariables(default_variables, params)
    else:
      operating_system = flavor
      if flavor == 'android':
        operating_system = 'linux'  # Keep this legacy behavior for now.
      default_variables.setdefault('OS', operating_system)
      default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
      default_variables.setdefault('SHARED_LIB_DIR',
                                   os.path.join('$!PRODUCT_DIR', 'lib'))
      default_variables.setdefault('LIB_DIR',
                                   os.path.join('$!PRODUCT_DIR', 'obj'))
function_tokens: def CalculateVariables ( default_variables , params ) : global generator_additional_non_configuration_keys global generator_additional_path_sections flavor = gyp . common . GetFlavor ( params ) if flavor == 'mac' : default_variables . setdefault ( 'OS' , 'mac' ) default_variables . setdefault ( 'SHARED_LIB_SUFFIX' , '.dylib' ) default_variables . setdefault ( 'SHARED_LIB_DIR' , generator_default_variables [ 'PRODUCT_DIR' ] ) default_variables . setdefault ( 'LIB_DIR' , generator_default_variables [ 'PRODUCT_DIR' ] ) # Copy additional generator configuration data from Xcode, which is shared # by the Mac Ninja generator. import gyp . generator . xcode as xcode_generator generator_additional_non_configuration_keys = getattr ( xcode_generator , 'generator_additional_non_configuration_keys' , [ ] ) generator_additional_path_sections = getattr ( xcode_generator , 'generator_additional_path_sections' , [ ] ) global generator_extra_sources_for_rules generator_extra_sources_for_rules = getattr ( xcode_generator , 'generator_extra_sources_for_rules' , [ ] ) elif flavor == 'win' : default_variables . setdefault ( 'OS' , 'win' ) default_variables [ 'EXECUTABLE_SUFFIX' ] = '.exe' default_variables [ 'STATIC_LIB_PREFIX' ] = '' default_variables [ 'STATIC_LIB_SUFFIX' ] = '.lib' default_variables [ 'SHARED_LIB_PREFIX' ] = '' default_variables [ 'SHARED_LIB_SUFFIX' ] = '.dll' # Copy additional generator configuration data from VS, which is shared # by the Windows Ninja generator. import gyp . generator . msvs as msvs_generator generator_additional_non_configuration_keys = getattr ( msvs_generator , 'generator_additional_non_configuration_keys' , [ ] ) generator_additional_path_sections = getattr ( msvs_generator , 'generator_additional_path_sections' , [ ] ) gyp . msvs_emulation . CalculateCommonVariables ( default_variables , params ) else : operating_system = flavor if flavor == 'android' : operating_system = 'linux' # Keep this legacy behavior for now. default_variables . setdefault ( 'OS' , operating_system ) default_variables . setdefault ( 'SHARED_LIB_SUFFIX' , '.so' ) default_variables . setdefault ( 'SHARED_LIB_DIR' , os . path . join ( '$!PRODUCT_DIR' , 'lib' ) ) default_variables . setdefault ( 'LIB_DIR' , os . path . join ( '$!PRODUCT_DIR' , 'obj' ) )