######################################################################################## # 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. # ######################################################################################## import os from waflib import Utils SUBFOLDERS = [ 'Builders', 'AssetBuilderSDK', 'AssetBuilder' ] def build(bld): bld.recurse(dirs=SUBFOLDERS) # mandatory - these folders are required defines = ['RESOURCE_COMPILER', 'EXCLUDE_CINEMIZER_SDK', 'EXCLUDE_OCULUS_SDK', 'NOMINMAX', 'UNICODE', 'METRICS_ENABLED'] console_defines = defines + ['BATCH_MODE'] metrics_uselib = [ "AWS_CPP_SDK_CORE", "AWS_CPP_SDK_COGNITO_IDP", "AWS_CPP_SDK_COGNITO_IDENTITY", "AWS_CPP_SDK_IDENTITY_MANAGEMENT", "AWS_CPP_SDK_LAMBDA", "AWS_CPP_SDK_MOBILEANALYTICS", "AWS_CPP_SDK_STS", "SSLEAY" ] bld.CryQtApplication( # Settings target = 'AssetProcessor', vs_filter = 'Tools/AssetProcessor', file_list = ['assetprocessor.waf_files', 'assetprocessor_gui.waf_files'], platforms = ['win', 'darwin', 'linux'], configurations = ['all'], exclude_monolithic = True, client_only = True, win_file_list = ['assetprocessor_win.waf_files'], darwin_file_list = ['assetprocessor_gui_macos.waf_files'], disable_pch = True, features = ['qt5', 'link_running_program', 'ExternalLyIdentity', 'ExternalLyMetrics'], includes = [bld.Path('Code/Tools/GemRegistry/include'), 'native', bld.Path('Code/CryEngine/CryCommon'), bld.Path("Code/Tools/LyMetrics/LyMetricsProducer/include") ], use = ['AzToolsFramework', 'AzQtComponents', 'AssetBuilderSDK', 'ToolsCrashHandler', 'XXHASH' ] + bld.make_aws_library_task_list(["LyMetricsProducer", "LyMetricsShared", "LyIdentity"]), uselib = ['QT5CORE', 'QT5GUI', 'QT5NETWORK', 'QT5QML', 'QT5WEBENGINEWIDGETS', 'QT5WEBENGINE', 'QT5WEBENGINECORE', 'QT5WIDGETS', 'QT5WINEXTRAS', 'QT5CONCURRENT', 'QT5XML', 'QTMAIN', 'SQLITE', 'D3D_COMPILER', 'SSLEAY', 'LUA_COMPILER' ] + metrics_uselib, defines = defines, # Compiler Specific msvc_cxxflags = ['/W4'], # Platform Specific win_features = ['generate_rc_file', 'crcfix'], win_lib = ['shell32'], darwin_rpath = ['@executable_path', '@executable_path/qtlibs/lib', '@executable_path/../Frameworks'], darwin_frameworks = ['ApplicationServices'], # used to make the GUI App foreground and allow input darwin_xcassets = 'Code/Tools/AssetProcessor/qml/Images.xcassets', darwin_x64_framework = ['Security'], darwin_lib = ['bsm'], linux_file_list = ['assetprocessor_gui_linux.waf_files'], linux_rpath = ['@executable_path', '@executable_path/qtlibs/lib'] ) bld.LYToolLauncher( target = 'AssetProcessorLauncher', vs_filter = 'ToolLaunchers', platforms = ['win', 'darwin', 'linux'], configurations = ['debug', 'profile'], launch_target = 'AssetProcessor', file_list = ['assetprocessor_launcher.waf_files'], use = ['AzFramework'], win_includes = ['native'], # for the resource.h file win_file_list = ['assetprocessor_win_launcher.waf_files'], includes = bld.Path('Code/Tools/ToolsLauncher'), # Platform Roots platform_roots = [bld.PlatformRoot('@ENGINE@/Code/Tools/ToolsLauncher/Platform', export_includes=True)], ) ########################################################################################################################################### ap_batch_platform_filter = ['win', 'darwin'] if bld.should_build_experimental_targets(): ap_batch_platform_filter.append('linux') bld.CryQtConsoleApplication( # Settings target = 'AssetProcessorBatch', vs_filter = 'Tools/AssetProcessor', file_list = ['assetprocessorbatch.waf_files'], win_file_list = ['assetprocessor_win.waf_files'], darwin_file_list = ['assetprocessor_macos.waf_files'], linux_file_list = ['assetprocessor_linux.waf_files'], platforms = ['win', 'darwin', 'linux'], configurations = ['all'], exclude_monolithic = True, client_only = True, disable_pch = True, features = ['qt5', 'ExternalLyIdentity', 'ExternalLyMetrics'], includes = [bld.Path('Code/Tools/GemRegistry/include'), 'native', bld.Path('Code/CryEngine/CryCommon'), bld.Path("Code/Tools/LyMetrics/LyMetricsProducer/include") ], win_features = ['generate_rc_file', 'crcfix'], use = ['AzToolsFramework', 'AssetBuilderSDK', 'XXHASH'] + bld.make_aws_library_task_list(["LyMetricsProducer", "LyMetricsShared", "LyIdentity"]), test_use = ['AzToolsFrameworkTestCommon'], uselib = ['QT5CORE', 'QT5GUI', 'QT5NETWORK', 'QT5WIDGETS', 'SQLITE', 'QT5XML'] + metrics_uselib, defines = console_defines, # Compiler Specific msvc_cxxflags = ['/W4'], # Platform Specific darwin_rpath = ['@executable_path', '@executable_path/qtlibs/lib'], linux_rpath = ['$ORIGIN/qtlibs/lib'], # ============================== # Testing # ============================== test_all_file_list = ['assetprocessor_test.waf_files'] ) bld.LYToolLauncher( target = 'AssetProcessorBatchLauncher', vs_filter = 'ToolLaunchers', platforms = ['win', 'darwin', 'linux'], configurations = ['debug', 'profile'], launch_target = 'AssetProcessorBatch', includes = bld.Path('Code/Tools/ToolsLauncher'), file_list = ['assetprocessor_launcher.waf_files'], use = ['AzFramework'], # Platform Roots platform_roots = [bld.PlatformRoot('@ENGINE@/Code/Tools/ToolsLauncher/Platform', export_includes=True)], win_includes = ['native'], # for the resource.h file win_lib = ['Shell32'], win_file_list = ['assetprocessor_win_launcher.waf_files'] ) def copy_asset_builder(pkg, executable_dest_node): output_folder_node = pkg.bld.get_output_folders(pkg.bld.platform, pkg.bld.config)[0] pkg.bld.install_files(executable_dest_node.abspath(), "AssetBuilder", cwd=output_folder_node, chmod=Utils.O755, postpone=False) pkg.codesign_executable_file(executable_dest_node.abspath() + "/AssetBuilder") rc_folder_node = output_folder_node.make_node('rc') rc_files = rc_folder_node.ant_glob("*") output_folder_node = output_folder_node.make_node('rc') resources_node = executable_dest_node.parent.make_node('Resources') rc_dest_node = executable_dest_node.make_node('rc') for file in rc_files: filename, file_extension = os.path.splitext(file.abspath()) if file_extension in ['.ini', '.xml', '.txt']: # data files need to go into the Resources directory otherwise code signing fails pkg.bld.create_symlink_or_copy(file, resources_node.abspath(), postpone=False) else: # Need 0755 permissions as rc is an exeutable. pkg.bld.create_symlink_or_copy(file, rc_dest_node.abspath(), chmod=Utils.O755, postpone=False)