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)
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.srcnode.make_node('Tools/AzCodeGenerator/bin/osx').abspath()

    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', 'Code/SDKs/markupsafe/x64', 'Code/SDKs/jinja2/x64']
    v['CODE_GENERATOR_PYTHON_DEBUG_PATHS'] = ['Code/SDKs/markupsafe/x64', '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)
Exemple #3
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)
Exemple #4
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)
Exemple #5
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)
Exemple #6
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 detect find the C++ compiler for Visual Studio 2013, 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.srcnode.make_node(
        'Tools/AzCodeGenerator/bin/vc120').abspath()
    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.srcnode.make_node('Tools/crcfix/bin/vc120').abspath()
    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]
Exemple #7
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)
Exemple #8
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')
Exemple #9
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)
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)