Пример #1
0
def load_win_x64_win_x64_vs2015_common_settings(conf):
    """
    Setup all compiler and linker settings shared over all win_x64_win_x64 configurations
    """
    v = conf.env

    global PLATFORM

    # Add defines to indicate a win64 build
    v['DEFINES'] += ['_WIN32', '_WIN64', 'NOMINMAX']

    # Make sure this is a supported platform
    if PLATFORM not in conf.get_supported_platforms():
        return

    # Attempt to detect the C++ compiler for VS 2015 ( msvs version 14.0 )
    windows_kit = conf.options.win_vs2015_winkit
    try:
        conf.auto_detect_msvc_compiler('msvc 14.0', 'x64', windows_kit)
    except:
        Logs.warn(
            'Unable to find Visual Studio 2015 C++ compiler and/or Windows Kit {}, removing build target'
            .format(windows_kit))
        conf.mark_supported_platform_for_removal(PLATFORM)
        return

    # Detect the QT binaries
    conf.find_qt5_binaries(PLATFORM)

    # Introduce the linker to generate 64 bit code
    v['LINKFLAGS'] += ['/MACHINE:X64']
    v['ARFLAGS'] += ['/MACHINE:X64']

    VS2015_FLAGS = [
        '/FS',  # Fix for issue writing to pdb files
        '/Wv:18'  # Stick with 2013 warnings for the time being...
    ]

    v['CFLAGS'] += VS2015_FLAGS
    v['CXXFLAGS'] += VS2015_FLAGS

    if conf.options.use_uber_files:
        v['CFLAGS'] += ['/bigobj']
        v['CXXFLAGS'] += ['/bigobj']

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/vc140')
    if not os.path.exists(azcg_dir):
        conf.fatal(
            'Unable to locate the AzCodeGenerator subfolder.  Make sure that you have VS2015 AzCodeGenerator binaries available'
        )
    v['CODE_GENERATOR_PATH'] = [azcg_dir]

    crcfix_dir = conf.Path('Tools/crcfix/bin/vc140')
    if not os.path.exists(crcfix_dir):
        Logs.warn(
            'Unable to locate the crcfix subfolder.  Make sure that you have VS2015 crcfix binaries available'
        )
    v['CRCFIX_PATH'] = [crcfix_dir]

    conf.find_dx12(windows_kit)
Пример #2
0
def load_win_x64_win_x64_vs2015_common_settings(conf):
    """
    Setup all compiler and linker settings shared over all win_x64_win_x64 configurations
    """
    v = conf.env

    global PLATFORM

    # Add defines to indicate a win64 build
    v['DEFINES'] += ['_WIN32', '_WIN64', 'NOMINMAX']

    restricted_tool_list_macro_header = 'AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS='
    restricted_tool_list_macro = restricted_tool_list_macro_header
    if len(restricted_tool_list_macro) > len(restricted_tool_list_macro_header):
        v['DEFINES'] += [ restricted_tool_list_macro ]

    # Make sure this is a supported platform
    if PLATFORM not in conf.get_supported_platforms():
        return

    # Attempt to detect the C++ compiler for VS 2015 ( msvs version 14.0 )
    windows_kit = conf.options.win_vs2015_winkit
    try:
        conf.auto_detect_msvc_compiler('msvc 14.0', 'x64', windows_kit)
    except:
        Logs.warn('Unable to find Visual Studio 2015 C++ compiler and/or Windows Kit {}, removing build target'.format(windows_kit))
        conf.mark_supported_platform_for_removal(PLATFORM)
        return

    # Detect the QT binaries, if the current capabilities selected requires it.
    _, enabled, _, _ = conf.tp.get_third_party_path(PLATFORM, 'qt')
    if enabled:
        conf.find_qt5_binaries(PLATFORM)

    # Introduce the linker to generate 64 bit code
    v['LINKFLAGS'] += ['/MACHINE:X64']
    v['ARFLAGS'] += ['/MACHINE:X64']

    VS2015_FLAGS = [
        '/FS'  # Fix for issue writing to pdb files
    ]

    v['CFLAGS'] += VS2015_FLAGS
    v['CXXFLAGS'] += VS2015_FLAGS

    if conf.options.use_uber_files:
        v['CFLAGS'] += ['/bigobj']
        v['CXXFLAGS'] += ['/bigobj']

    crcfix_dir = conf.Path('Tools/crcfix/bin/vc140')
    if not os.path.exists(crcfix_dir):
        Logs.warn('Unable to locate the crcfix subfolder.  Make sure that you have VS2015 crcfix binaries available')
    v['CRCFIX_PATH'] = [crcfix_dir]

    conf.find_dx12(windows_kit)
Пример #3
0
def load_win_x64_win_x64_vs2017_common_settings(conf):
    """
    Setup all compiler and linker settings shared over all win_x64_win_x64 configurations
    """
    v = conf.env

    global PLATFORM

    # Add defines to indicate a win64 build and configure VS2017 warnings
    v['DEFINES'] += [
        '_WIN32', '_WIN64', 'NOMINMAX',
        '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING',
        '_ENABLE_EXTENDED_ALIGNED_STORAGE'
    ]

    restricted_tool_list_macro_header = 'AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS='
    restricted_tool_list_macro = restricted_tool_list_macro_header
    if len(restricted_tool_list_macro) > len(
            restricted_tool_list_macro_header):
        v['DEFINES'] += [restricted_tool_list_macro]

    # Make sure this is a supported platform
    if PLATFORM not in conf.get_supported_platforms():
        return

    # Attempt to detect the C++ compiler for VS 2017 ( msvs version 15.0 )
    windows_kit = conf.options.win_vs2017_winkit
    vcvarsall_args = windows_kit + ' ' + conf.options.win_vs2017_vcvarsall_args
    try:
        conf.auto_detect_msvc_compiler('msvc 15', 'x64', vcvarsall_args)
    except:
        Logs.warn(
            'MSVS 2017 will be removed as a build target. We were unable to find an installation of Visual Studio 2017 that matches win_vs2017_vswhere_args=({}), Windows Kit with win_vs2017_winkit=({}), and win_vs2017_vcvarsall_args=({}).'
            .format(conf.options.win_vs2017_vswhere_args, windows_kit,
                    conf.options.win_vs2017_vcvarsall_args))
        Logs.warn(
            'Lumberyard defaults use a known good set of options at the time of product release. If your project requires different configuration for MSVS 2017, you can modify these settings in _WAF_/user_settings.options under [Windows Options].'
        )
        conf.mark_supported_platform_for_removal(PLATFORM)
        return

    # Detect the QT binaries, if the current capabilities selected requires it.
    _, enabled, _, _ = conf.tp.get_third_party_path(PLATFORM, 'qt')
    if enabled:
        conf.find_qt5_binaries(PLATFORM)

    # Introduce the linker to generate 64 bit code
    v['LINKFLAGS'] += ['/MACHINE:X64']
    v['ARFLAGS'] += ['/MACHINE:X64']

    VS2017_FLAGS = [
        '/FS'  # Fix for issue writing to pdb files
    ]

    v['CFLAGS'] += VS2017_FLAGS
    v['CXXFLAGS'] += VS2017_FLAGS

    if conf.options.use_uber_files:
        v['CFLAGS'] += ['/bigobj']
        v['CXXFLAGS'] += ['/bigobj']

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/vc141')
    if not os.path.exists(azcg_dir):
        azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/vc140')
        if not os.path.exists(azcg_dir):
            conf.fatal(
                'Unable to locate the AzCodeGenerator subfolder.  Make sure that you have VS2017 AzCodeGenerator binaries available'
            )
    v['CODE_GENERATOR_PATH'] = [azcg_dir]

    crcfix_dir = conf.Path('Tools/crcfix/bin/vc141')
    if not os.path.exists(crcfix_dir):
        crcfix_dir = conf.Path('Tools/crcfix/bin/vc140')
        if not os.path.exists(crcfix_dir):
            Logs.warn(
                'Unable to locate the crcfix subfolder.  Make sure that you have VS2017 crcfix binaries available'
            )
    v['CRCFIX_PATH'] = [crcfix_dir]

    conf.find_dx12(windows_kit)