######################################################################################## # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or the license accompanying this file. Do not # remove or modify any license notices. This file is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # # Original file Copyright Crytek GMBH or its affiliates, used under license. # ######################################################################################## from waflib import Logs def build(bld): qt_version = None if getattr(bld, "get_qt_version", None): qt_version = bld.get_qt_version() # macOS requires access to the versioned specific headers for platform specific # support for the editor additional_qt_includes = [] if qt_version is not None: additional_qt_includes = [bld.ThirdPartyPath('qt', '/clang_64/lib/QtGui.framework/Headers/'+qt_version), bld.ThirdPartyPath('qt', '/clang_64/lib/QtWidgets.framework/Headers/'+qt_version), bld.ThirdPartyPath('qt', '/clang_64/lib/QtWidgets.framework/Headers/'+qt_version+'/QtWidgets') ] additionalDefines = [ ] version = bld.get_lumberyard_version() additionalDefines.append( 'METRICS_VERSION="' + version + '"' ) if version != "0.0.0.0": additionalDefines.append( 'USE_EXTERNAL_METRICS_ENDPOINT' ) bld.CryEditorCore( # Settings target = 'EditorCore', vs_filter = 'Sandbox', pch = 'StdAfx.cpp', file_list = 'editor_core.waf_files', platforms = ['win', 'darwin', 'linux'], configurations = ['all'], exclude_monolithic = True, client_only = True, use = ['AzToolsFramework', 'AzQtComponents'], uselib = ['QT5CORE', 'QT5GUI', 'QT5NETWORK', 'QT5WEBENGINEWIDGETS', 'QT5WEBENGINE', 'QT5WEBENGINECORE', 'QT5WIDGETS', 'QT5WINEXTRAS', 'ZLIB'], features = ['qt5'], includes = [bld.Path('Code/CryEngine/CryCommon'), bld.Path('Code/Sandbox/Plugins/EditorCommon'), bld.ThirdPartyPath('squish'), 'Include', bld.Path('Code/Tools')], # Compiler Specific msvc_cxxflags = ['/wd4355'], clang_cxxflags = ['-Wno-array-bounds', # Squish includes have this code like this that triggers this warning: sets >= 2? array[sets - 2] : NULL '-Wno-format', '-Wno-macro-redefined',], # Platform Specific darwin_includes = additional_qt_includes, darwin_enable_rtti = True, linux_enable_rtti = True, win_enable_rtti = True, win_features = ['crcfix'], linux_rpath = ['$ORIGIN/qtlibs/lib'], # Testing test_all_file_list = ['editor_core_test.waf_files'], ) #By default the Editor is built with tools to edit Terrain. #If you remove the LY_TERRAIN_EDITOR macro constant, then all of those #Terrain editing tools will be removed from Editor.exe. #This is useful for customers who author Terrain assets through external #tools, or simply make games that don't require a terrain system at all. fileList = ['editor_lib.waf_files'] testFileList = ['editor_lib_test.waf_files'] if bld.is_option_true('enable_legacy_terrain_editor'): additionalDefines.append('LY_TERRAIN_EDITOR') fileList.append('editor_lib_terrain.waf_files') testFileList.append('editor_lib_test_terrain.waf_files') # In order to print the warning message only once, the type of the object # is checked. Otherwise the WARNING message will be printed for each build variant # which can be annoying. if str(type(bld)) == "": game_project_list = bld.get_enabled_game_project_list() for game_project in game_project_list: gems = bld.get_game_gems(game_project) legacyTerrainGemIsEnabled = False for gem in gems: if gem.name == "LegacyTerrain": legacyTerrainGemIsEnabled = True break if not legacyTerrainGemIsEnabled: Logs.warn("[WARNING] For project <{}>, The Legacy Terrain editor tools are enabled, but the Legacy Terrain Gem is not.".format(game_project)) kw = dict( # Settings target = 'EditorLib', vs_filter = 'Sandbox', copyright_org = 'Amazon-CryTek', pch = 'StdAfx.cpp', file_list = fileList, darwin_file_list = 'editor_lib_darwin.waf_files', linux_file_list = 'editor_lib_linux.waf_files', win_file_list = ['editor_lib_windows.waf_files'], platforms = ['win', 'darwin', 'linux'], configurations = ['all'], exclude_monolithic = True, client_only = True, includes = ['.', bld.Path('Code/CryEngine/CryCommon'), bld.Path('Code/Sandbox/Plugins/EditorCommon'), '..', 'Include', bld.ThirdPartyPath('squish'), bld.Path('Code/CryEngine'), bld.Path('Code/CryEngine/CrySystem'), bld.Path('Gems/LmbrCentral/Code/include'), bld.Path('Code/Tools/'), bld.Path('Code/Tools/News'), bld.Path('Code/Tools/GemRegistry/include'), bld.Path('Code/Lyzard/SDK/include'), bld.Path('Code/Lyzard/Modules/Gems/include'), bld.Path('Code/Lyzard/Modules/Projects/include'), bld.Path('Code/Lyzard/Modules/Engines/include')], defines = ['LY_BUILD={}'.format(bld.get_lumberyard_build()), 'DONT_BAN_STD_STRING', 'USE_MEM_ALLOCATOR'] + additionalDefines, use = ['AzToolsFramework', 'AzQtComponents', 'EditorCommon', 'EditorCore', 'EditorUI_QT', 'NewsShared', 'AWSNativeSDKInit', 'ToolsCrashHandler'] + bld.make_aws_library_task_list(['LyMetricsProducer', 'LyMetricsShared', 'LyIdentity']), test_use = ['AzFrameworkTestShared'], uselib = ['QT5CORE', 'QT5GUI', 'QT5NETWORK', 'QT5QML', 'QT5SVG', 'QT5WEBENGINEWIDGETS', 'QT5WEBENGINE', 'QT5WEBENGINECORE', 'QT5WIDGETS', 'QT5WINEXTRAS', 'QT5XML', 'QT5CONCURRENT', 'TIFF', 'AWS_CPP_SDK_STS', 'AWS_CPP_SDK_CORE', 'AWS_CPP_SDK_COGNITO_IDENTITY', 'AWS_CPP_SDK_DEVICEFARM', 'AWS_CPP_SDK_MOBILEANALYTICS', 'AWS_CPP_SDK_IDENTITY_MANAGEMENT', 'AWS_CPP_SDK_IDENTITY_LAMBDA', 'AWS_CPP_SDK_IDENTITY_METRICS', 'ZLIB'], use_required_gems = True, features = ['qt5', 'ExternalLyIdentity', 'ExternalLyMetrics', 'EmbeddedPython'], langname = 'en-us', win_linkflags = ['/SUBSYSTEM:WINDOWS'], win_debug_all_linkflags = '/NODEFAULTLIB:LIBCMTD.lib', win_ndebug_linkflags = '/NODEFAULTLIB:LIBCMT.lib', msvc_cxxflags = [ '/Zm200', '/wd4355', '/wd4018', '/wd4267' ], # Platform Specific win_features = [ 'crcfix' ], winres_defines = ['NDEBUG' ], win_lib = ['version'], win_enable_rtti = True, clang_cxxflags = ['-Wno-sometimes-uninitialized', # required for squish library to compile '-Wno-shift-negative-value', # required for squish library to compile '-Wno-null-dereference', # required for squish library to compile '-Wno-deprecated-declarations', # using Gesalt macOS calls that are deprecated. '-Wno-writable-strings', '-Wno-return-type', '-Wno-enum-compare-switch', '-Wno-microsoft-include', #SQUISH ], darwin_lib = ['curl', 'bsm'], darwin_includes = [bld.Path('Code/Sandbox/Editor/Mannequin/Controls'), bld.Path('Code/Sandbox/Editor/AssetBrowser'), bld.Path('Code/Sandbox/Editor/Controls'), bld.Path('Code/Sandbox/Editor/AI')] + additional_qt_includes, darwin_x64_framework = ['Security'], darwin_enable_rtti = True, linux_rpath = ['$ORIGIN/qtlibs/lib'], linux_lib = ['jpeg','jbig'], linux_x64_lib = ['jpeg', 'jbig'], # Our 3rdparty libtiff.a depends on libjpeg and libjbig # Testing test_all_file_list = testFileList, ) for p0, p1, p2, p3 in bld.env['RESTRICTED_PLATFORMS']: kw['win_file_list'].append('{0}/editor_lib_{1}.waf_files'.format(p0, p1)) bld.CryEditorLib(**kw) enabled_platforms = ['win', 'linux'] if bld.should_build_experimental_targets(): enabled_platforms.append('darwin') tsk_gen = bld.CryEditor( # Settings target = 'Editor', vs_filter = 'Sandbox', copyright_org = 'Amazon-CryTek', file_list = 'editor.waf_files', platforms = enabled_platforms, configurations = ['all'], exclude_monolithic = True, client_only = True, includes = ['.', bld.Path('Code/CryEngine/CryCommon'), '..', 'Include', bld.Path('Code/CryEngine'), bld.Path('Code/CryEngine/CrySystem'), bld.Path('Gems/LmbrCentral/Code/include'), bld.Path('Code/Tools/'), bld.ThirdPartyPath('squish'), bld.Path('Code/Tools/News'), bld.Path('Code/Tools/GemRegistry/include'), bld.Path('Code/Lyzard/SDK/include'), bld.Path('Code/Lyzard/Modules/Gems/include'), bld.Path('Code/Lyzard/Modules/Projects/include'), bld.Path('Code/Lyzard/Modules/Engines/include')], defines = ['DONT_BAN_STD_STRING', 'USE_MEM_ALLOCATOR'] + additionalDefines, use = ['AzToolsFramework', 'AzQtComponents', 'EditorCommon', 'EditorCore', 'EditorLib', 'EditorUI_QT', 'NewsShared'], uselib = ['QT5CORE', 'QT5GUI', 'QT5NETWORK', 'QT5QML', 'QT5WEBENGINEWIDGETS', 'QT5WEBENGINE', 'QT5WEBENGINECORE', 'QT5WIDGETS', 'QT5WINEXTRAS', 'QT5CONCURRENT', 'QT5XML', 'QTMAIN', 'QT5DBUS', 'AWS_CPP_SDK_STS', 'AWS_CPP_SDK_CORE', 'AWS_CPP_SDK_COGNITO_IDENTITY', 'AWS_CPP_SDK_MOBILEANALYTICS', 'AWS_CPP_SDK_IDENTITY_MANAGEMENT', 'TIFF', 'ZLIB', 'D3D_COMPILER', 'OPENSSL', 'MSVC90', 'LUA_COMPILER' ], use_required_gems = True, features = ['qt5', 'ExternalLyIdentity', 'ExternalLyMetrics'], langname = 'en-us', win_file_list = ['editor_win.waf_files'], win_linkflags = ['/SUBSYSTEM:WINDOWS'], win_debug_all_linkflags = '/NODEFAULTLIB:LIBCMTD.lib', win_ndebug_linkflags = '/NODEFAULTLIB:LIBCMT.lib', msvc_cxxflags = [ '/Zm200', '/wd4355', '/wd4018', '/wd4267' ], # Platform Specific win_features = [ 'crcfix' ], win_use = bld.make_aws_library_task_list(['LyMetricsProducer', 'LyIdentity']), winres_defines = ['NDEBUG' ], win_lib = ['Shell32'], darwin_file_list = ['editor_darwin.waf_files'], darwin_enable_rtti = True, clang_cxxflags = ['-Wno-error', '-Wno-unused-local-typedef'], darwin_lib = ['curl', 'bsm'], darwin_rpath = ['@executable_path/', '@executable_path/qtlibs/lib', '@executable_path/rc', '@executable_path/EditorPlugins', '@executable_path/../Frameworks'], darwin_use = bld.make_aws_library_task_list(['LyMetricsProducer', 'LyIdentity']), darwin_includes = [bld.Path('Code/Sandbox/Editor/Mannequin/Controls'), bld.Path('Code/Sandbox/Editor/AssetBrowser'), bld.Path('Code/Sandbox/Editor/Controls'), bld.Path('Code/Sandbox/Editor/AI')] + additional_qt_includes, darwin_x64_framework = ['Security'], darwin_xcassets = 'Code/Sandbox/Editor/res/Images.xcassets', linux_enable_rtti = True, linux_rpath = ['@executable_path/', '@executable_path/qtlibs/lib', '@executable_path/rc', '@executable_path/EditorPlugins'] ) bld.LYToolLauncher( target = 'EditorLauncher', vs_filter = 'ToolLaunchers', platforms = ['win'], configurations = ['debug', 'profile'], file_list = ['editor_launcher.waf_files'], win_file_list = ['editor_win_launcher.waf_files'], win_lib = ['Shell32'], launch_target = 'Editor', includes = bld.Path('Code/Tools/ToolsLauncher'), # Platform Roots platform_roots = [bld.PlatformRoot('@ENGINE@/Code/Tools/ToolsLauncher/Platform', export_includes=True)], use = ['AzFramework'], ) if tsk_gen != None: # Copy Resource.h for Ribbon UI tsk_gen.create_task('copy_outputs', tsk_gen.path.make_node('Resource.h'), bld.srcnode.make_node('Editor/UI/Resource.h') ) def package(pkg): if pkg.should_build_experimental_targets(): build(pkg) # Need to call this to generate our task_generator pkg.package_tool( target = 'Editor', platforms = ['darwin'], configurations = ['debug', 'profile'], include_all_libs = True, dir_resources = ['qtlibs', 'EditorPlugins'], )