コード例 #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_vs2013_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 2013 ( msvs version 12.0 )
    try:
        conf.auto_detect_msvc_compiler('msvc 12.0', 'x64', '')
    except:
        Logs.warn(
            'Unable to find Visual Studio 2013 C++ compiler, removing build target'
        )
        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']

    VS2013_FLAGS = [
        '/FS',  # Fix for issue writing to pdb files
        '/Zo'  # Enhanced optimized debugging (increases pdb size but has no effect on code size and improves debugging) - this is enabled by default for vs2015.
    ]

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

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

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

    crcfix_dir = conf.Path('Tools/crcfix/bin/vc120')
    if not os.path.exists(crcfix_dir):
        Logs.warn(
            'Unable to locate the crcfix subfolder.  Make sure that you have VS2013 crcfix binaries available'
        )
    v['CRCFIX_PATH'] = [crcfix_dir]
コード例 #3
0
def load_win_x64_android_armv8_clang_common_settings(conf):
    """
    Setup all compiler and linker settings shared over all win_x64_android_armv8_clang configurations
    """
    env = conf.env

    # load the toolchains
    ndk_root = env['ANDROID_NDK_HOME']

    gcc_toolchain_root = os.path.join(ndk_root, 'toolchains',
                                      'aarch64-linux-android-4.9', 'prebuilt',
                                      'windows-x86_64')
    gcc_toolchain_path = os.path.join(gcc_toolchain_root, 'bin')

    clang_toolchain_path = os.path.join(ndk_root, 'toolchains', 'llvm',
                                        'prebuilt', 'windows-x86_64', 'bin')

    ndk_toolchains = {
        'CC': 'clang',
        'CXX': 'clang++',
        'AR': 'aarch64-linux-android-ar',
        'STRIP': 'aarch64-linux-android-strip',
    }

    if not conf.load_android_toolchains(
        [clang_toolchain_path, gcc_toolchain_path], **ndk_toolchains):
        conf.fatal('[ERROR] android_armv8_clang setup failed')

    if not conf.load_android_tools():
        conf.fatal('[ERROR] android_armv8_clang setup failed')

    # common settings
    gcc_toolchain = '--gcc-toolchain={}'.format(gcc_toolchain_root)
    target_arch = '--target=aarch64-none-linux-android'  # <arch><sub>-<vendor>-<sys>-<abi>

    common_flags = [
        gcc_toolchain,
        target_arch,
    ]

    env['CFLAGS'] += common_flags[:]
    env['CXXFLAGS'] += common_flags[:]
    env['LINKFLAGS'] += common_flags[:]

    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):
        azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/vc120')
    if not os.path.exists(azcg_dir):
        conf.fatal(
            'Unable to locate the AzCodeGenerator subfolder.  Make sure that you have either VS2013, VS2015, or VS2017 binaries available'
        )
    env['CODE_GENERATOR_PATH'] = [azcg_dir]
コード例 #4
0
def load_linux_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is linux x64
    """
    v = conf.env

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/linux')

    v['CODE_GENERATOR_EXECUTABLE'] = 'AzCodeGenerator'
    v['CODE_GENERATOR_PATH'] = [ azcg_dir ]
    v['CODE_GENERATOR_PYTHON_PATHS'] = [conf.Path('Tools/Python/3.7.5/linux_x64/lib/python3.7'),
                                        conf.Path('Tools/Python/3.7.5/linux_x64/lib'),
                                        conf.Path('Tools/Python/3.7.5/linux_x64/lib/python3.7/lib-dynload'),
                                        conf.ThirdPartyPath('markupsafe', 'x64'),
                                        conf.ThirdPartyPath('jinja2', 'x64')]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [conf.Path('Tools/Python/3.7.5/linux_x64/lib/python3.7'),
                                              conf.Path('Tools/Python/3.7.5/linux_x64/lib/python3.7/lib-dynload'),
                                              conf.ThirdPartyPath('markupsafe', 'x64'),
                                              conf.ThirdPartyPath('jinja2', 'x64')]
    v['EMBEDDED_PYTHON_HOME_RELATIVE_PATH'] = 'Tools/Python/3.7.5/linux_x64'
    v['CODE_GENERATOR_PYTHON_HOME'] = conf.Path(v['EMBEDDED_PYTHON_HOME_RELATIVE_PATH'])
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = conf.Path('Tools/Python/3.7.5/linux_x64')
    v['CODE_GENERATOR_INCLUDE_PATHS'] = [conf.ThirdPartyPath('Clang', 'linux_x64/release/lib/clang/6.0.1/include')]
    
    v['EMBEDDED_PYTHON_HOME'] = v['CODE_GENERATOR_PYTHON_HOME']
    # Set include path to the pymalloc build
    v['EMBEDDED_PYTHON_INCLUDE_PATH'] = os.path.join(v['EMBEDDED_PYTHON_HOME'], 'include/python3.7m')
    v['EMBEDDED_PYTHON_LIBPATH'] = os.path.join(v['EMBEDDED_PYTHON_HOME'], 'lib')
    v['EMBEDDED_PYTHON_SHARED_OBJECT'] = os.path.join(v['EMBEDDED_PYTHON_HOME'], 'lib/libpython3.7m.so.1.0')

    # 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)
コード例 #5
0
def load_darwin_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is darwin (OSX) x64
    """
    v = conf.env

    global PLATFORM

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/osx')

    v['CODE_GENERATOR_EXECUTABLE'] = 'AzCodeGenerator'
    v['CODE_GENERATOR_PATH'] = [ azcg_dir ]
    v['CODE_GENERATOR_PYTHON_PATHS'] = ['/System/Library/Frameworks/Python.framework/Versions/2.7',
                                        '/System/Library/Frameworks/Python.framework/Versions/2.7/lib',
                                        '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
                                        '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
                                        conf.ThirdPartyPath('markupsafe', 'x64'),
                                        conf.ThirdPartyPath('jinja2', 'x64')]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [conf.ThirdPartyPath('markupsafe', 'x64'),
                                              conf.ThirdPartyPath('jinja2', 'x64')]
    v['CODE_GENERATOR_PYTHON_HOME'] = '/System/Library/Frameworks/Python.framework/Versions/2.7'
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = '/System/Library/Frameworks/Python.framework/Versions/2.7'

    clang_search_dirs = subprocess.check_output(['clang++', '-print-search-dirs']).strip().split('\n')
    clang_search_paths = {}
    for search_dir in clang_search_dirs:
        (type, dirs) = search_dir.split(': =')
        clang_search_paths[type] = dirs.split(':')
    v['CLANG_SEARCH_PATHS'] = clang_search_paths

    # 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)
def load_common_win_x64_vs2015_test_settings(conf):
    conf.env['DEFINES'] += ['AZ_TESTS_ENABLED']

    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'
        )
コード例 #7
0
def load_linux_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is linux x64
    """
    v = conf.env

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/linux')

    v['CODE_GENERATOR_EXECUTABLE'] = 'AzCodeGenerator'
    v['CODE_GENERATOR_PATH'] = [azcg_dir]
    v['CODE_GENERATOR_PYTHON_PATHS'] = [
        conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7'),
        conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7/lib-dynload'),
        conf.ThirdPartyPath('markupsafe', 'x64'),
        conf.ThirdPartyPath('jinja2', 'x64')
    ]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [
        conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7'),
        conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7/lib-dynload'),
        conf.ThirdPartyPath('markupsafe', 'x64'),
        conf.ThirdPartyPath('jinja2', 'x64')
    ]
    v['CODE_GENERATOR_PYTHON_HOME'] = conf.Path(
        'Tools/Python/2.7.12/linux_x64')
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = conf.Path(
        'Tools/Python/2.7.12/linux_x64')
    v['CODE_GENERATOR_INCLUDE_PATHS'] = [
        conf.ThirdPartyPath('Clang',
                            'linux_x64/release/lib/clang/6.0.1/include')
    ]

    # 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)
コード例 #8
0
def load_win_x64_android_armv7_gcc_common_settings(conf):
    """
    Setup all compiler and linker settings shared over all win_x64_android_armv7_gcc configurations
    """
    env = conf.env

    # load the toolchains
    ndk_root = env['ANDROID_NDK_HOME']

    toolchain_path = os.path.join(ndk_root, 'toolchains',
                                  'arm-linux-androideabi-4.9', 'prebuilt',
                                  'windows-x86_64', 'bin')

    ndk_toolchains = {
        'CC': 'arm-linux-androideabi-gcc',
        'CXX': 'arm-linux-androideabi-g++',
        'AR': 'arm-linux-androideabi-ar',
        'STRIP': 'arm-linux-androideabi-strip',
    }

    if not conf.load_android_toolchains([toolchain_path], **ndk_toolchains):
        conf.fatal('[ERROR] android_armv7_gcc setup failed')

    if not conf.load_android_tools():
        conf.fatal('[ERROR] android_armv7_gcc setup failed')

    # common settings
    target_arch_flag = [
        '-march=armv7-a'  # armeabi-v7a
    ]

    env['CFLAGS'] += target_arch_flag[:]
    env['CXXFLAGS'] += target_arch_flag[:]
    env['LINKFLAGS'] += target_arch_flag[:]

    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):
        azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/vc120')
    if not os.path.exists(azcg_dir):
        conf.fatal(
            'Unable to locate the AzCodeGenerator subfolder.  Make sure that you have either VS2013, VS2015, or VS2017 binaries available'
        )
    env['CODE_GENERATOR_PATH'] = [azcg_dir]
コード例 #9
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)
コード例 #10
0
def load_darwin_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is darwin (OSX) x64
    """
    v = conf.env

    global PLATFORM

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/osx')

    v['CODE_GENERATOR_EXECUTABLE'] = 'AzCodeGenerator'
    v['CODE_GENERATOR_PATH'] = [azcg_dir]
    v['CODE_GENERATOR_PYTHON_PATHS'] = [
        '/System/Library/Frameworks/Python.framework/Versions/2.7',
        '/System/Library/Frameworks/Python.framework/Versions/2.7/lib',
        '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
        '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
        conf.Path('Code/SDKs/markupsafe/x64'),
        conf.Path('Code/SDKs/jinja2/x64')
    ]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [
        conf.Path('Code/SDKs/markupsafe/x64'),
        conf.Path('Code/SDKs/jinja2/x64')
    ]
    v['CODE_GENERATOR_PYTHON_HOME'] = '/System/Library/Frameworks/Python.framework/Versions/2.7'
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = '/System/Library/Frameworks/Python.framework/Versions/2.7'

    clang_search_dirs = subprocess.check_output(
        ['clang++', '-print-search-dirs']).strip().split('\n')
    clang_search_paths = {}
    for search_dir in clang_search_dirs:
        (type, dirs) = search_dir.split(': =')
        clang_search_paths[type] = dirs.split(':')
    v['CLANG_SEARCH_PATHS'] = clang_search_paths

    # Detect the QT binaries that should be symlinked to Code/Sandbox/SDKs/Qt at this point
    conf.find_qt5_binaries(PLATFORM)
コード例 #11
0
def load_linux_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is linux x64
    """
    v = conf.env

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/linux')

    v['CODE_GENERATOR_EXECUTABLE'] = 'AzCodeGenerator'
    v['CODE_GENERATOR_PATH'] = [ azcg_dir ]
    v['CODE_GENERATOR_PYTHON_PATHS'] = [conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7'),
                                        conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7/lib-dynload'),
                                        conf.Path('Code/SDKs/markupsafe/x64'),
                                        conf.Path('Code/SDKs/jinja2/x64')]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7'),
                                              conf.Path('Tools/Python/2.7.12/linux_x64/lib/python2.7/lib-dynload'),
                                              conf.Path('Code/SDKs/markupsafe/x64'),
                                              conf.Path('Code/SDKs/jinja2/x64')]
    v['CODE_GENERATOR_PYTHON_HOME'] = conf.Path('Tools/Python/2.7.12/linux_x64')
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = conf.Path('Tools/Python/2.7.12/linux_x64')

    # Detect the QT binaries
    conf.find_qt5_binaries('linux_x64')
コード例 #12
0
def load_win_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is win x64
    """
    v = conf.env

    # Setup the environment for the AZ Code Generator

    # Look for the most recent version of the code generator subfolder.  This should be either installed or built by the bootstrap process at this point
    global AZCG_VALIDATED_PATH
    if AZCG_VALIDATED_PATH is None:
        az_code_gen_subfolders = ['bin/vc140', 'bin/vc120']
        validated_azcg_dir = None
        for az_code_gen_subfolder in az_code_gen_subfolders:
            azcg_dir = conf.Path('Tools/AzCodeGenerator/{}'.format(az_code_gen_subfolder))
            azcg_exe = os.path.join(azcg_dir, AZ_CODE_GEN_EXECUTABLE)
            if os.path.exists(azcg_exe):
                Logs.debug('lumberyard: Found AzCodeGenerator at {}'.format(azcg_dir))
                validated_azcg_dir = azcg_dir
                break
        AZCG_VALIDATED_PATH = validated_azcg_dir
        if validated_azcg_dir is None:
            conf.fatal('Unable to locate the AzCodeGenerator subfolder.  Make sure that you have either the VS2013 or VS2015 binaries available')

    v['CODE_GENERATOR_EXECUTABLE'] = AZ_CODE_GEN_EXECUTABLE
    v['CODE_GENERATOR_PATH'] = [AZCG_VALIDATED_PATH]
    v['CODE_GENERATOR_PYTHON_PATHS'] = [conf.Path('Tools/Python/2.7.12/windows/Lib'),
                                        conf.Path('Tools/Python/2.7.12/windows/libs'),
                                        conf.Path('Tools/Python/2.7.12/windows/DLLs'),
                                        conf.Path('Code/SDKs/markupsafe/x64'),
                                        conf.Path('Code/SDKs/jinja2/x64')]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [conf.Path('Tools/Python/2.7.12/windows/Lib'),
                                              conf.Path('Tools/Python/2.7.12/windows/libs'),
                                              conf.Path('Tools/Python/2.7.12/windows/DLLs'),
                                              conf.Path('Code/SDKs/markupsafe/x64'),
                                              conf.Path('Code/SDKs/jinja2/x64')]
    v['CODE_GENERATOR_PYTHON_HOME'] = conf.Path('Tools/Python/2.7.12/windows')
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = conf.Path('Tools/Python/2.7.12/windows')

    v['CRCFIX_EXECUTABLE'] = 'crcfix.exe'
コード例 #13
0
def load_win_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is win x64
    """
    v = conf.env

    # Setup the environment for the AZ Code Generator

    # Look for the most recent version of the code generator subfolder.  This should be either installed or built by the bootstrap process at this point
    global AZCG_VALIDATED_PATH
    if AZCG_VALIDATED_PATH is None:
        az_code_gen_subfolders = ['bin/windows']
        validated_azcg_dir = None
        for az_code_gen_subfolder in az_code_gen_subfolders:
            azcg_dir = conf.Path(
                'Tools/AzCodeGenerator/{}'.format(az_code_gen_subfolder))
            azcg_exe = os.path.join(azcg_dir, AZ_CODE_GEN_EXECUTABLE)
            if os.path.exists(azcg_exe):
                Logs.debug(
                    'lumberyard: Found AzCodeGenerator at {}'.format(azcg_dir))
                validated_azcg_dir = azcg_dir
                break
        AZCG_VALIDATED_PATH = validated_azcg_dir
        if validated_azcg_dir is None:
            conf.fatal(
                'Unable to locate the AzCodeGenerator subfolder.  Make sure that the Windows binaries are available'
            )

    v['CODE_GENERATOR_EXECUTABLE'] = AZ_CODE_GEN_EXECUTABLE
    v['CODE_GENERATOR_PATH'] = [AZCG_VALIDATED_PATH]
    v['CODE_GENERATOR_PYTHON_PATHS'] = [
        conf.Path('Tools/Python/3.7.10/windows/Lib'),
        conf.Path('Tools/Python/3.7.10/windows/libs'),
        conf.Path('Tools/Python/3.7.10/windows/DLLs'),
        conf.ThirdPartyPath('markupsafe', 'x64'),
        conf.ThirdPartyPath('jinja2', 'x64')
    ]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [
        conf.Path('Tools/Python/3.7.10/windows/Lib'),
        conf.Path('Tools/Python/3.7.10/windows/libs'),
        conf.Path('Tools/Python/3.7.10/windows/DLLs'),
        conf.ThirdPartyPath('markupsafe', 'x64'),
        conf.ThirdPartyPath('jinja2', 'x64')
    ]
    v['EMBEDDED_PYTHON_HOME_RELATIVE_PATH'] = 'Tools/Python/3.7.10/windows'
    v['CODE_GENERATOR_PYTHON_HOME'] = conf.Path(
        v['EMBEDDED_PYTHON_HOME_RELATIVE_PATH'])
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = conf.Path(
        'Tools/Python/3.7.10/windows')
    v['CODE_GENERATOR_INCLUDE_PATHS'] = []

    v['EMBEDDED_PYTHON_HOME'] = v['CODE_GENERATOR_PYTHON_HOME']
    v['EMBEDDED_PYTHON_INCLUDE_PATH'] = os.path.join(v['EMBEDDED_PYTHON_HOME'],
                                                     'include')
    v['EMBEDDED_PYTHON_LIBPATH'] = os.path.join(v['EMBEDDED_PYTHON_HOME'],
                                                'libs')
    v['EMBEDDED_PYTHON_SHARED_OBJECT'] = os.path.join(
        v['EMBEDDED_PYTHON_HOME'], 'python37.dll')

    crcfix_dir = conf.Path('Tools/crcfix/bin/windows')
    if not os.path.exists(crcfix_dir):
        Logs.warn(
            'Unable to locate the crcfix subfolder.  Make sure that the Windows crcfix binaries are available'
        )
    v['CRCFIX_PATH'] = [crcfix_dir]
    v['CRCFIX_EXECUTABLE'] = 'crcfix.exe'
コード例 #14
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)
コード例 #15
0
def load_darwin_x64_host_settings(conf):
    """
    Setup any environment settings you want to apply globally any time the host doing the building is darwin (OSX) x64
    """
    v = conf.env

    global PLATFORM

    azcg_dir = conf.Path('Tools/AzCodeGenerator/bin/osx')

    v['CODE_GENERATOR_EXECUTABLE'] = 'AzCodeGenerator'
    v['CODE_GENERATOR_PATH'] = [azcg_dir]
    v['CODE_GENERATOR_PYTHON_PATHS'] = [
        conf.Path('Tools/Python/3.7.10/mac/Python.framework/Versions/3.7'),
        conf.Path('Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib'),
        conf.Path(
            'Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7'
        ),
        conf.Path(
            'Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib-dynload'
        ),
        conf.ThirdPartyPath('markupsafe', 'x64'),
        conf.ThirdPartyPath('jinja2', 'x64')
    ]
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = [
        conf.ThirdPartyPath('markupsafe', 'x64'),
        conf.ThirdPartyPath('jinja2', 'x64'),
        conf.Path('Tools/Python/3.7.10/mac/Python.framework/Versions/3.7'),
        conf.Path('Tools/Python/3.7.10/mac/Python.framework/Versions/3.7'),
        conf.Path(
            'Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7'
        ),
        conf.Path(
            'Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib-dynload'
        )
    ]

    v['EMBEDDED_PYTHON_HOME_RELATIVE_PATH'] = 'Tools/Python/3.7.10/mac/Python.framework/Versions/3.7'
    v['CODE_GENERATOR_PYTHON_HOME'] = conf.Path(
        v['EMBEDDED_PYTHON_HOME_RELATIVE_PATH'])
    v['CODE_GENERATOR_PYTHON_HOME_DEBUG'] = conf.Path(
        'Tools/Python/3.7.10/mac/Python.framework/Versions/3.7')
    v['CODE_GENERATOR_INCLUDE_PATHS'] = []

    v['EMBEDDED_PYTHON_HOME'] = v['CODE_GENERATOR_PYTHON_HOME']
    # Set include path to the pymalloc build
    v['EMBEDDED_PYTHON_INCLUDE_PATH'] = os.path.join(v['EMBEDDED_PYTHON_HOME'],
                                                     'include/python3.7m')
    v['EMBEDDED_PYTHON_LIBPATH'] = os.path.join(v['EMBEDDED_PYTHON_HOME'],
                                                'lib')
    v['EMBEDDED_PYTHON_SHARED_OBJECT'] = os.path.join(
        v['EMBEDDED_PYTHON_HOME'], 'lib/libpython3.7m.dylib')

    clang_search_dirs = subprocess.check_output(
        ['clang++',
         '-print-search-dirs']).decode(sys.stdout.encoding or 'iso8859-1',
                                       'replace').strip().split('\n')
    clang_search_paths = {}
    for search_dir in clang_search_dirs:
        (type, dirs) = search_dir.split(': =')
        clang_search_paths[type] = dirs.split(':')
    v['CLANG_SEARCH_PATHS'] = clang_search_paths

    # 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)