######################################################################################## # 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. ######################################################################################## def build_supports_wwise_sdk(bld, wwise_uselib): platform, configuration = bld.get_platform_and_configuration() # No WWISELTX on restricted platforms if 'WWISELTX' in wwise_uselib: for _, _, _, p3 in bld.env['RESTRICTED_PLATFORMS']: if p3 in platform: return False # client_only = True if 'dedicated' in configuration: return False # All other configs are supported return True def build(bld): # Set the flavor of Wwise you are using: # 'WWISE' = Full version of Wwise SDK # 'WWISELTX' = LTX version of Wwise SDK (default) wwise_flavor = 'WWISELTX' # Don't change these values! # Set these attributes on bld context for use in layout creation # (See also Config_wwise.h) bld.audio_middleware = 'wwise' bld.audio_config_file = 'wwise_config.json' # Check if we can build Wwise for this build configuration... is_gem_valid = build_supports_wwise_sdk(bld, wwise_flavor) non_release_defines = ['ENABLE_AUDIO_LOGGING', 'INCLUDE_WWISE_IMPL_PRODUCTION_CODE'] apple_frameworks = ['AVFoundation', 'AudioToolbox', 'CoreAudio'] win_libs = ['Ole32', 'OleAut32', 'dxguid', 'ws2_32', 'XInput', 'Winmm', 'DInput8', 'DSound'] testing_includes = [bld.Path('Gems/AudioEngineWwise/Code/Tests')] testing_defines = ['INCLUDE_WWISE_IMPL_PRODUCTION_CODE'] testing_editor_defines = ['AUDIO_ENGINE_WWISE_EDITOR'] + testing_defines # # Editor Module - This is the Wwise-specific facet of the AudioControlsEditor plugin # editor_kw = dict( disable_pch = True, vs_filter = 'Gems/Audio', file_list = ['audioenginewwise.waf_files', 'audioenginewwise_editor.waf_files'], includes = [bld.Path('Code/CryEngine/CryCommon'), bld.Path('Gems/AudioEngineWwise/Code/Source'), bld.Path('Gems/AudioEngineWwise/Code/Source/Builder'), bld.Path('Gems/AudioEngineWwise/Code/Source/Editor'), bld.Path('Gems/AudioEngineWwise/Code/Source/Engine'), bld.Path('Gems/AudioSystem/Code/Include/Editor'), bld.Path('Gems/AudioSystem/Code/Include/Engine'), bld.Path('Code/Sandbox/Editor')], defines = ['AUDIO_ENGINE_WWISE_EDITOR'] + non_release_defines, # Platform Roots platform_roots = [bld.PlatformRoot('Platform', export_includes=False)], platforms = ['win', 'darwin', 'linux'], use = ['EditorCommon', 'AssetBuilderSDK'], uselib = [wwise_flavor, 'QT5CORE'], features = ['qt5'], win_lib = win_libs, darwin_x64_framework = apple_frameworks, linux_x64_lib = ['SDL2'], # Testing test_all_file_list = ['audioenginewwise_editor_tests.waf_files'], # Note: 'test_all_includes' and 'test_all_defines' are broken. # They don't properly add include search paths or preprocessor defines to the VS projects. debug_test_includes = testing_includes, profile_test_includes = testing_includes, debug_test_defines = testing_editor_defines, profile_test_defines = testing_editor_defines, ) # # Game Module # game_kw = dict( # General disable_pch = True, vs_filter = 'Gems/Audio', file_list = ['audioenginewwise.waf_files'], includes = [bld.Path('Code/CryEngine/CryCommon'), bld.Path('Gems/AudioEngineWwise/Code/Source'), bld.Path('Gems/AudioEngineWwise/Code/Source/Engine'), bld.Path('Gems/AudioSystem/Code/Include/Engine')], # Platform Roots platform_roots = [bld.PlatformRoot('Platform', export_includes=False)], debug_defines = non_release_defines, profile_defines = non_release_defines, uselib = [wwise_flavor], win_lib = win_libs, ios_framework = apple_frameworks, appletv_framework = apple_frameworks, darwin_x64_framework = apple_frameworks, android_lib = ['OpenSLES'], linux_x64_lib = ['SDL2'], # Testing test_all_file_list = ['audioenginewwise_tests.waf_files'], # Note: 'test_all_includes' and 'test_all_defines' are broken. # They don't properly add include search paths or preprocessor defines to the VS projects. debug_test_includes = testing_includes, profile_test_includes = testing_includes, debug_test_defines = testing_defines, profile_test_defines = testing_defines, Editor = editor_kw ) # # Define a stub Gem module that doesn't contain any real code # stub_kw = dict( disable_pch = True, file_list = ['audioenginewwise_stub.waf_files'], disable_tests = True, Editor = dict( disable_pch = True, file_list = ['audioenginewwise_stub.waf_files'], platforms = ['win', 'darwin', 'linux'], disable_tests = True, ) ) if is_gem_valid: bld.DefineGem(**game_kw) else: bld.DefineGem(**stub_kw)