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 ]
def load_release_msvc_settings(conf): """ Setup all compiler/linker flags with are shared over all targets using the microsoft compiler for the "release" 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', # omit the frame pointer '/GS-', # Don't Use Buffer Security checks ] v['CFLAGS'] += COMPILER_FLAGS v['CXXFLAGS'] += COMPILER_FLAGS v['LINKFLAGS'] += [ '/OPT:REF', # Eliminate not referenced functions/data (incompatible with incremental linking) '/OPT:ICF', # Perform Comdat folding (incompatible with incremental linking) '/INCREMENTAL:NO', # Disable Incremental Linking ]
def load_release_msvc_settings(conf): """ Setup all compiler/linker flags with are shared over all targets using the microsoft compiler for the "release" 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', # omit the frame pointer '/GL', # Whole-program optimization ] v['CFLAGS'] += COMPILER_FLAGS v['CXXFLAGS'] += COMPILER_FLAGS v['LINKFLAGS'] += [ '/OPT:REF', # Eliminate not referenced functions/data '/OPT:ICF', # Perform Comdat folding '/LTCG', # Link time code generation ] v['ARFLAGS'] += [ '/LTCG', # Link time code generation ] set_ltcg_threads(conf)
def load_win_x64_vs2013_common_settings(ctx): env = ctx.env global PLATFORM # Attempt to detect the C++ compiler for VS 2013 ( msvs version 12.0 ) try: ctx.auto_detect_msvc_compiler('msvc 12.0', 'x64', '') except Exception as err: raise Errors.WafError( "Unable to find Visual Studio 2013 C++ compiler: {}".format( str(err))) # Detect the QT binaries ctx.find_qt5_binaries(PLATFORM) if ctx.options.use_uber_files: env['CFLAGS'] += ['/bigobj'] env['CXXFLAGS'] += ['/bigobj'] if not env['CODE_GENERATOR_PATH']: raise Errors.WafError( '[Error] AZ Code Generator path not set for target platform {}'. format(PLATFORM)) if not env['CRCFIX_PATH']: raise Errors.WafError( '[Error] CRCFix path not set for target platform {}'.format( PLATFORM)) conf.load_msvc_common_settings() conf.load_windows_common_settings() conf.load_cryengine_common_settings()
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 '/GS', # Use Buffer Security checks '/bigobj', # Ensure we can store enough objects files ] v['CFLAGS'] += COMPILER_FLAGS v['CXXFLAGS'] += COMPILER_FLAGS
def load_performance_msvc_settings(conf): """ Setup all compiler/linker flags with are shared over all targets using the microsoft compiler for the "performance" 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', # omit the frame pointer '/GS-', # Don't Use Buffer Security checks ] v['CFLAGS'] += COMPILER_FLAGS v['CXXFLAGS'] += COMPILER_FLAGS apply_incremental_linking(conf)
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
def load_release_msvc_settings(conf): """ Setup all compiler/linker flags with are shared over all targets using the microsoft compiler for the "release" 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', # omit the frame pointer '/GS-', # Don't Use Buffer Security checks ] v['CFLAGS'] += COMPILER_FLAGS v['CXXFLAGS'] += COMPILER_FLAGS v['LINKFLAGS'] += [ '/OPT:REF', # Eliminate not referenced functions/data '/OPT:ICF', # Perform Comdat folding ]