WAF Module File (wscript)

Cry Module Types

CryEngineModule

CryEngineModules are compiled as dynamic libraries for the target platform. (e.g. *.dll, *.so)
Except the project is configured to output a monolithic build. See WAF Project File (projects.json) for more info.

def build(bld):
    bld.CryEngineModule(
        target     = 'MyModule',
        vs_filter  = 'MyVSFilter',        
        file_list  = 'my_module.waf_files'
    )    
CryEngineStaticModule

CryEngineStaticModules are compiled as static libraries for the target platform. (e.g. *.lib, *.a)
Except the project is configured to output a monolithic build. See WAF Project File (projects.json) for more info.

def build(bld):    
    bld.CryEngineStaticModule( 
        target      = 'MyModule', 
        vs_filter   = 'MyVSFilter',
        file_list   = 'my_module.waf_files'
  )
CryLauncher

CryLauncher modules act as a wrapper module to create the final executable for the target platform. (e.g. *.exe)
The executable file will be the final output target if the project is configured to output a monolithic build. See WAF Project File (projects.json) for more info.

def build(bld):
    bld.CryLauncher(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryDedicatedServer

CryDedicatedServer modules act as a wrapper module to create the final executable for the target platform. (e.g. *.exe)
The executable file will be the final output target if the project is configured to output a monolithic build. See WAF Project File (projects.json) for more info.

def build(bld):
    bld.CryDedicatedServer(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryConsoleApplication

CryConsoleApplication modules act as a wrapper for console applications.

def build(bld):
    bld.CryConsoleApplication(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryFileContainer

CryFileContainer modules act as a file container module. Use to collect common code shared between many modules. The CryEngine's CryCommon module is an example of such.

This module produces no output.

def build(bld):
    bld.CryFileContainer(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryEditor

CryEditor is a special wrapper for the CryEngine Editor.

def build(bld):
    bld.CryEditor (
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryPlugin

CryPlugin act as a wrapper for CryEngine Editor Plug-ins.

def build(bld):
    bld.CryPlugin (
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryPluginModule

CryPluginModule acts as a wrapper for the CryEngine Editor utilities dynamic library which is used by multiple CryPlugin modules.

def build(bld):
    bld.CryPluginModule(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryResourceCompiler

CryResourceCompiler acts as a wrapper for the Cry Resource Compiler.

def build(bld):
    bld.CryResourceCompiler(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryResourceCompilerModule

CryResourceCompilerModule acts as a wrapper for Cry Resource Compiler modules.

def build(bld):
    bld.CryResourceCompilerModule(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }
CryPipelineModule

CryPipelineModule acts as a wrapper for pipeline modules. Mostly used for Digital Content Creation (DCC) exporters.

def build(bld):
    bld.CryPipelineModule(
        target      = 'MyModule',
        vs_filter   = 'MyVSFilter',        
        file_list   = 'module.waf_files'
  }

Entries

Tip: Entries that are marked "dynamic" can be constructed using Platform Dependent Entries markup.

target

Type: string
Dynamic: No


Name of the module. This name is used to include the module as part of a build pipline in the WAF Spec Files.

pch

Type: string
Dynamic: No

Location of the precompiled head if available. If set pre-compiled header compilation is enabled for the project.

Tip: If you need to exclude a single file from pre-compiled compilation, you can do so targeting the file using the additional_settings entry.
e.g. additional_settings = Settings( files = 'myfile.cpp', disable_pch = True )

vs_filter

Type: string
Dynamic: No

The filter name this project should show up in the Visual Studio Solution Explorer

file_list

Type: List
Dynamic: Yes

Location of the the WAF File Lists, relative to the wscript, which defines which files are part of this module.
Additionally allows grouping files into uber files as well as place them under a specific Visual Studio project filter

source

Type: List
Dynamic: No

Add source files directly.
Note: Files to be included as source files for the module. Note: To place a source file into an uber file, please use file_list.

files

Type: List
Dynamic: No

A flat raw list of source files to be included for the module. Note: To place a source file into an uber file, please use file_list.

qt_to_moc_files

Type: List
Dynamic: No

A list of files that need to go through the QT moc processor before being compiled. These files should also be listed in the file_list.
CryModuleTypes using qt_to_moc_files have to ensure that 'qt' is part of the features list.

features

Type: List
Dynamic: No

Extend the build pipeline for this module with specific features such as:

  • use_r_files
  • qt
  • durango_title_id
includes

Type: List
Dynamic: Yes

Specifies the include paths to be included for this module.
Tip: Use the Path("") Utility function to specify root relative paths

priority_includes

Type: List
Dynamic: Yes

Added prior to includes entries!

Specifies the include paths to be included for this module.
Tip: Use the Path("") Utility function to specify root relative paths

lib

Type: List
Dynamic: Yes

Specifies the libraries to be included for this module.
Tip: Use the Path("") Utility function to specify root relative paths

libpath

Type: List
Dynamic: Yes

Specifies the library paths to be included for this module.
Tip: Use the Path("") Utility function to specify root relative paths

defines

Type: List
Dynamic: Yes

Specifies the compiler flags defines for this module.

cflags

Type: List
Dynamic: Yes

Specifies compiler flags for the *.c file compiler for this module.

cxxflags

Type: List
Dynamic: Yes

Specifies compiler flags for the *.cpp file compiler for this module.

linkflags

Type: List
Dynamic: Yes

Specifies the linker flags defines for this module.

use_module

Type: List
Dynamic: Yes

Allows interaction of dynamic or static CryModuleTypes libraries. Unlike the "use" entry, modules included via the "use_module" entry will be build inheriting their parents compiler/linker flags, to ensure that the resulting library is compatible with the library including it.

use

Type: List
Dynamic: Yes

A WAF feature that allow interaction of static/dynamic libraries as well as object files.
See https://waf.io/book/#_library_interaction_use for more information.

Note: Consider using additional_settings and use_module instead.

framework

Type: List
Dynamic: Yes

Specify the framework to use. Aimed for Darwin development.
A list of OS X Frameworks can be found here Apple Developer page.

meta_includes

Type: List
Dynamic: Yes

Specify the include path for Durango WinRT meta include files.
Tip: Use the Path("") Utility function to specify root relative paths

output_file_name

Type: String
Dynamic: Yes
Default: Module name

Specify the final ouput name of the module.

additional_settings

Type: List
Dynamic: Yes

Specify the final ouput name of the module.

def build(bld):
    bld.CryEngineModule(
    ...
    additional_settings = Settings( files = 'my_special_file.cpp', disable_pch = True )  
    win_x64_additional_settings = Settings( files = 'my_special_file.cpp', disable_pch = True )  
    win_x64_debug_additional_settings = Settings( files = 'my_special_file.cpp', disable_pch = True )  
    ...
  )
create_appdata

Type: Bool
Dynamic: No

Durango only!
Creates and/or collects all relevant resources to create an Durango application such as AppXManifest, appdata.bin, required DLL's and resources

need_deploy

Type: Bool
Dynamic: No

Adds hint that this Cry Module Type needs deploying before debugging to Visual Studio project.

output_sub_folder

Type: String
Dynamic: No

Direct WAF to copy final Cry Module Type binaries into a subfolder of the output folder. e.g. BinX64/MySubfolder.

additional_manifests

Add a manifest file to your MSVC compiled Windows application e.g. to add DPI Awareness.

force_static_crt

Type: Bool
Dynamic: No

Force usage of static run-time CRT. Sets /MTd (debug) or /MT .
See https://msdn.microsoft.com/de-de/library/2kzt1wy3.aspx for more info.

force_dynamic_crt

Type: Bool
Dynamic: No

Force usage of dynamic run-time CRT. Sets /MDd (debug) or /MD .
See https://msdn.microsoft.com/de-de/library/2kzt1wy3.aspx for more info.

env

WAF allows you yo override the environment used. Example usage of this is to override the output pattern of binary files or add specific paths to the global PATH environment.

def build(bld):

  # Example: Maya DLL plugin's have the exstension '.mll' instead of '.dll'
  # We create a deep copy of the environment first to prevent accidentally modifying other task generators. 
  w_env = bld.env.derive()
  w_env.detach()
  w_env['cshlib_PATTERN'] = '%s.mll'
  w_env['cxxshlib_PATTERN'] = '%s.mll'

  bld.CryPipelineModule( 
    ...
    env = w_env,
    ... )