Gem Configuration Examples
The following are example configurations for gems and their wscript
files.
Gem with a GameModule
The following example gem adds one module type as
GameModule
.
{ "GemFormatVersion": 4, "Uuid": "e5f049ad7f534847a89c27b7339cf6a6", // Required "Name": "MyGem", // Required "Version": "1.0.0", // Required "Modules": [ // Optional { "Type": "GameModule" // Required } ] }
The following is the wscript
file for the gem.
def build(bld): bld.DefineGem( # The following are the default settings, and do not need to be specified (unless changes are desired) # target = ['MyGem'], # file_list = ['mygem.waf_files'], # vs_filter = ['Gems'], )
Gem with a GameModule and Name
The following example gem has one module type as GameModule
and
specifies a name for that module.
{ "GemFormatVersion": 4, // Required "Uuid": "e5f049ad7f534847a89c27b7339cf6a6", // Required "Name": "MyGem", // Required "Version": "1.0.0", // Required "Modules": [ // Optional { "Type": "GameModule", // Required "Name": "Components" // Required } ] }
The following is the wscript
file for the gem.
def build(bld): bld.DefineGem( Components = dict( # The following are the default settings, and do not need to be specified (unless changes are desired) # target = ['MyGem.Components'], # file_list = ['mygem_components.waf_files'], # vs_filter = ['Gems'], ), )
Gem with a StaticLib and Name
The following example gem has one module type as StaticLib
and
specifies a name for that module.
{ "GemFormatVersion": 4, // Required "Uuid": "e5f049ad7f534847a89c27b7339cf6a6", // Required "Name": "MyGem", // Required "Version": "1.0.0", // Required "Modules": [ // Optional { "Type": "StaticLib", // Required "Name": "HelperCode" // Required } ] }
The following is the wscript
file for the gem.
def build(bld): bld.DefineGem( HelperCode = dict( # The following are the default settings, and do not need to be specified (unless changes are desired) # target = ['MyGem.HelperCode'], # file_list = ['mygem_helpercode.waf_files'], # vs_filter = ['Gems'], ), )
Gem with an EditorModule and Name
The following example gem has one module type as EditorModule
and
specifies a name for the module.
{ "GemFormatVersion": 4, // Required "Uuid": "e5f049ad7f534847a89c27b7339cf6a6", // Required "Name": "MyGem", // Required "Version": "1.0.0", // Required "Modules": [ // Optional { "Type": "EditorModule", // Required "Name": "Editor" // Required } ] }
The following is the wscript
file for the gem.
def build(bld): bld.DefineGem( Editor = dict( # The following are the default settings, and do not need to be specified (unless changes are desired) # target = ['MyGem.Editor'], # file_list = ['mygem_editor.waf_files'], # vs_filter = ['Gems'], # platforms = ['win', 'darwin'], # configurations = ['debug', 'debug_test', 'profile', 'profile_test'], ), )
Gem with an EditorModule That Extends a GameModule
The following example gem has two module types, GameModule
and
EditorModule
, specifies a name for both, and then extends the
EditorModule
.
{ "GemFormatVersion": 4, // Required "Uuid": "e5f049ad7f534847a89c27b7339cf6a6", // Required "Name": "MyGem", // Required "Version": "1.0.0", // Required "Modules": [ // Optional { "Type": "GameModule", // Required "Name": "Components" // Optional }, { "Type": "EditorModule", // Required "Name": "Editor", // Required "Extends": "Components" // Optional } ] }
The following is the wscript
file for the gem.
def build(bld): bld.DefineGem( Components = dict( # The following are the default settings, and do not need to be specified (unless changes are desired) # target = ['MyGem.Components'], # file_list = ['mygem_components.waf_files'], # vs_filter = ['Gems'], defines = ['MY_GEM'], use = ['AzCore'], ), Editor = dict( # The following are the default settings, and do not need to be specified (unless changes are desired) # target = ['MyGem.Editor'], # file_list = ['mygem_components.waf_files', 'mygem_editor.waf_files'], # vs_filter = ['Gems'], # platforms = ['win', 'darwin'], # configurations = ['debug', 'debug_test', 'profile', 'profile_test'], # defines = ['MY_GEM'], # this is inherited from Components use = ['AzToolsFramework'], # This overrides the Components module's 'use', so only 'AzToolsFramework' is 'use'd ), )