Version

menu_open
Wwise SDK 2024.1.1
Configuring Your Project With Premake

The premake command generates the solutions that will be used by the build command to build your plug-in. The default Premake configuration file generated by the new command works out of the box, however, further modifications will be needed to work on your plug-in. The generated solutions should not be modified directly as calling the premake command again will overwrite all changes to these files. Instead, modify the Premake configuration file. This configuration file is located at the root of your plug-in and is named PremakePlugin.lua.

Looking at the top of the PremakePlugin.lua file, notice a global table named Plugin is created. It contains the definition of the Wwise plug-in that Premake will import and use to generate the required projects and solutions. Entries of that table include the following:

  • The name entry is a string that corresponds to the name of the plug-in, used as a prefix for all generated projects and solutions.
  • The factoryheader entry is a string corresponding to the relative path to the factory header that will be installed with the plug-in into the public include directory of the Wwise SDK.
  • The appleteamid entry is a string corresponding to the development team ID to set in the Signing & Capabilities section of an Xcode project, which is required for signing binaries on Apple platforms.
  • The signtoolargs entry is an array, implemented as an integer-indexed table, which provides arguments to forward to SignTool.exe in a post-build step to sign dynamic libraries on Windows. When the array is empty, the post-build step is not added to the project.

Notice how the rest of the file is divided into three similar sections. Each section contains a table with various lists of strings that are used to configure how a solution is generated:

  • The Plugin.sdk.static table is used to configure the static SDK plug-in.
  • The Plugin.sdk.shared table is used to configure the shared SDK plug-in, which links to the static SDK plug-in (this is done under the hood by premake scripts).
  • The Plugin.authoring table is used to configure the Authoring plug-in, which links to the static SDK plug-in.

Further information on how to populate each list is found in the Premake documentation:

Once the plug-in project has been created, other commands, such as premake, must be called from within the project folder. Here is how to generate the solutions for Authoring on the current operating system:

cd MyNewFX
python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" premake Authoring

Available platforms are:

Android, Authoring, Authoring_Windows, Authoring_Linux, Authoring_Mac, iOS, Linux, LinuxAuto, Mac, NX, OpenHarmony, PS4, PS5, QNX, tvOS, visionOS, Windows_vc160, Windows_vc170, WinGC, XboxOneGC, XboxSeriesX

When the solutions are generated, refer to Building Your Project for the Different Wwise Platforms to build and install your plug-in in your Wwise installation.

Note: To disable the code signing post-build step of shared libraries during development, you may pass the flag –disable-codesign to the premake action.

Static Authoring Configuration

Even though it is not included in the generated PremakePlugin.lua file, there is also an optional Plugin.sdk.authoringstatic table. This is used for unique use cases and provides a different configuration for the static SDK plug-in that is linked to the Authoring plug-in. For example, this demonstrates how to re-use the same SDK plug-in code with a FOR_AUTHORING compiler define:

Plugin.sdk.staticauthoring = {}
-- SDK STATIC AUTHORING PLUGIN SECTION
Plugin.sdk.staticauthoring.includedirs = Plugin.sdk.static.includedirs
Plugin.sdk.staticauthoring.files = Plugin.sdk.static.files
Plugin.sdk.staticauthoring.excludes = Plugin.sdk.static.excludes
Plugin.sdk.staticauthoring.links = Plugin.sdk.static.links
Plugin.sdk.staticauthoring.libdirs = Plugin.sdk.static.libdirs
Plugin.sdk.staticauthoring.defines = table.join(Plugin.sdk.static.defines, { "FOR_AUTHORING" })

Advanced Premake Configuration

Notice how configuring a project is fairly straightforward since most of the Premake code is hidden in the configuration table. For a more advanced configuration, add a custom field to any of the following configuration sections:

Plugin.sdk.static.custom = function()
-- put your Premake code here
end
Plugin.sdk.shared.custom = function()
-- put your Premake code here
end
Plugin.authoring.custom = function()
-- put your Premake code here
end

Next section: Building Your Project for the Different Wwise Platforms


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise