Beispiel #1
0
def load_profile_msvc_settings(conf):
    """
    Setup all compiler/linker flags with are shared over all targets using the microsoft compiler
    for the "profile" configuration 
    """
    v = conf.env
    conf.load_msvc_common_settings()
    
    COMPILER_FLAGS = [
        '/Ox',      # Full optimization
        '/Ob2',     # Inline any suitable function
        '/Ot',      # Favor fast code over small code
        '/Oi',      # Use Intrinsic Functions
        '/Oy-',     # Don't omit the frame pointer      
        ]
        
    v['CFLAGS'] += COMPILER_FLAGS
    v['CXXFLAGS'] += COMPILER_FLAGS
    
    if conf.is_option_true('use_recode'):
        Logs.pprint('CYAN', 'Enabling Recode-safe linker settings and defines for Profile build')
        v['DEFINES'] += ['AZ_PROFILE_DISABLE_THREAD_LOCAL'] # Disable AZ Profiler's thread-local optimization, as it conflicts with Recode
        v['LINKFLAGS'] += [
                                   # No /OPT:REF or /OPT:ICF for Recode builds
            '/FUNCTIONPADMIN:14'   # Reserve function padding for patch injection (improves Recoding)
            ]
    else:
        v['LINKFLAGS'] += [
            '/OPT:REF',            # elimination of unreferenced functions/data
            '/OPT:ICF',            # comdat folding
            ]
Beispiel #2
0
def load_debug_msvc_settings(conf):
    """
    Setup all compiler/linker flags with are shared over all targets using the microsoft compiler
    for the "debug" configuration   
    """
    v = conf.env    
    conf.load_msvc_common_settings()
    
    COMPILER_FLAGS = [
        '/Od',      # Disable all optimizations
        '/Ob0',     # Disable all inling
        '/Oy-',     # Don't omit the frame pointer
        '/RTC1',    # Add basic Runtime Checks
        '/bigobj',  # Ensure we can store enough objects files
        ]
        
    v['CFLAGS'] += COMPILER_FLAGS
    v['CXXFLAGS'] += COMPILER_FLAGS

    if conf.is_option_true('use_recode'):
        Logs.pprint('CYAN', 'Enabling Recode-safe defines for Debug build')
        v['DEFINES'] += ['AZ_PROFILE_DISABLE_THREAD_LOCAL'] # Disable AZ Profiler's thread-local optimization, as it conflicts with Recode