######################################################################################## # 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 def build(bld): win_x64_cxxflags = ['/wd4267','/wd4244','/wd4800','/wd4146'] win_x64_defines = ['_CRT_SECURE_NO_WARNINGS', '_SCL_SECURE_NO_WARNINGS', 'AZCG_COMPILER_MSVC', 'AZCG_PLATFORM_WINDOWS'] darwin_x64_cxxflags = ['-w', '-pthread', '-Wno-register'] darwin_x64_defines = ['__STDC_CONSTANT_MACROS','__STDC_LIMIT_MACROS', 'AZCG_COMPILER_CLANG', 'AZCG_PLATFORM_DARWIN'] darwin_x64_lib = ['python3.7m', 'z'] darwin_x64_rpath = '@loader_path' linux_x64_cxxflags = ['-w', '-stdlib=libstdc++', '-pthread', '-Wno-register', '-fno-rtti'] linux_x64_defines = ['__STDC_CONSTANT_MACROS','__STDC_LIMIT_MACROS', 'AZCG_PLATFORM_LINUX'] linux_x64_lib = ['python3.7m', 'z', 'util', 'dl'] linux_x64_linkflags = list(linux_x64_cxxflags) # ['-pthread', '-stdlib=libstdc++'] platform, configuration = bld.get_platform_and_configuration() pydll = None if platform.startswith('win_') or platform == 'project_generator': pydll = 'Tools/Python/3.7.10/windows/python37.dll' elif platform.startswith('linux_'): pydll = 'Tools/Python/3.7.10/linux_x64/lib/libpython3.7m.so' elif platform.startswith('darwin_'): pydll = 'Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/libpython3.7m.dylib' source_artifacts = [ pydll ] if pydll else [] source_artifacts += [ 'Code/Tools/AzCodeGenerator/Scripts/az_code_gen', 'Code/Tools/AzCodeGenerator/Scripts/jinja_extensions', 'Code/Tools/AzCodeGenerator/Scripts/launcher.py', 'Code/Tools/AzCodeGenerator/Scripts/debug.py' ] output_folder_windows = ['Tools/AzCodeGenerator/bin/windows/'] output_folder_darwin = ['Tools/AzCodeGenerator/bin/osx/'] output_folder_linux = ['Tools/AzCodeGenerator/bin/linux/'] bld.CryBuildUtility( target = 'AzCodeGenerator', platforms = ['win', 'darwin', 'linux'], configurations = ['all'], exclude_monolithic = True, vs_filter = 'Tools', file_list = 'azcodegenerator.waf_files', pch = 'precompiled.cpp', use = ['RAPIDJSON', 'CLANG'], features = ['EmbeddedPython'], win_lib = [ 'version' ], source_artifacts_include = source_artifacts, win_cxxflags=win_x64_cxxflags, darwin_x64_cxxflags = darwin_x64_cxxflags, linux_x64_cxxflags = linux_x64_cxxflags, win_defines=win_x64_defines, darwin_x64_defines = darwin_x64_defines, linux_x64_defines = linux_x64_defines, darwin_x64_lib=darwin_x64_lib, linux_x64_lib=linux_x64_lib, linux_x64_libpath=[bld.Path('Tools/Python/3.7.5/linux_x64/lib')], darwin_x64_libpath=[bld.Path('Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib')], linux_x64_linkflags=linux_x64_linkflags, darwin_x64_rpath=darwin_x64_rpath, win_x64_output_folder=output_folder_windows, darwin_x64_output_folder=output_folder_darwin, linux_x64_output_folder=output_folder_linux, ndebug_output_file_name='AzCodeGenerator', debug_output_file_name='AzCodeGeneratorD', # running "lmbr_waf clean_win_x64_*" should not remove AzCodeGenerator as there would be no way to re-build from a package exclude_from_clean=True )