######################################################################################## # 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(bld): # Set Config Based Defines (not including IMGUI_ENABLED turns ImGui off and no-ops much of the code.) configBaseDefines=[] configBaseDefinesEditor=[] if bld.env['CONFIGURATION'] == 'profile' or bld.env['CONFIGURATION'] == 'debug' or bld.env['CONFIGURATION'] == 'performance': configBaseDefines.append('IMGUI_ENABLED') configBaseDefinesEditor.append('IMGUI_ENABLED') configBaseDefinesEditor.append('IMGUI_GEM_EDITOR') # ImGui has a few win32 specific functions to turn off when not on that platform. win32Platform=[x for x in ['win'] if x in bld.env['PLATFORM']] != [] if win32Platform == False: configBaseDefines += ['IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS', 'IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS'] bld.CryEngineSharedLibrary( target='imguilib', vs_filter='Gems/ImguiLib', platforms = ['all'], configurations = ['all'], file_list = ['imgui_lib.waf_files'], use = ['AzCore'], defines = configBaseDefines, export_includes=[bld.Path('Gems/ImGui/External/ImGui/v1.70')], export_defines=['IMGUI_API_IMPORT', 'IMGUI_INCLUDE_IMGUI_USER_H'], platform_roots=[bld.PlatformRoot('Source/Platform', export_includes=False)] ) bld.CryEngineStaticLibrary( target = 'ImGuiLYUtils', vs_filter = 'Gems/ImguiLib', includes = ['.', 'Include', 'Source', bld.Path('Code/CryEngine/CryCommon'), bld.Path('Gems/ImGui/External/ImGui/v1.70')], use = ['imguilib', 'AzToolsFramework', 'AzQtComponents', 'AzCore', 'AzFramework'], file_list = ['imgui_lyutils_static.waf_files'], defines = configBaseDefines, platform_roots=[bld.PlatformRoot('Source/Platform', export_includes=False)] ) #Common Editor and Game Includes COMMON_INCLUDES = [ '.', bld.Path('Code/CryEngine/CryCommon'), bld.Path('Gems/LmbrCentral/Code/include') ] COMMON_USE = ['imguilib', 'AzFramework', 'LmbrCentral'] bld.DefineGem( includes = COMMON_INCLUDES, use = COMMON_USE, file_list = [ 'imgui_common.waf_files', 'imgui_lyutils_static.waf_files' ], defines = configBaseDefines, linux_rpath = ['$ORIGIN'], platform_roots=[bld.PlatformRoot('Source/Platform', export_includes=False)], ######################################## # Editor Module configuration editor = dict( includes = COMMON_INCLUDES + ['Editor', 'Source', bld.Path('Gems/ImGui/External/ImGui/v1.70'), bld.Path('Code/Sandbox/Plugins/EditorCommon'), bld.Path('Code/Sandbox/Editor') ], # Editor requires QT Components for the ImGui Edtior Panel. use = COMMON_USE + [ 'AzQtComponents' ], file_list = [ 'imgui_common.waf_files', 'imgui_editor.waf_files', 'imgui_lyutils_static.waf_files' ], defines = configBaseDefinesEditor, platform_roots=[bld.PlatformRoot('Source/Platform', export_includes=False)], uselib=['QT5CORE','QT5GUI','QT5WIDGETS'], features=['qt5'] ) )