Skip to Content

Build Configuration

The SDK uses conditional compilation with the USE_NUNU_SDK preprocessor directive to easily exclude it from builds. This ensures zero overhead in production builds.

Implementation Details

We use module-level compile definitions to exclude all SDK-related code from compilation, including both core SDK files and custom flayer functions.

When USE_NUNU_SDK is set to 0, the SDK functionality is disabled during compilation. When set to 1, all SDK code compiles normally and the SDK initializes with full functionality.

// NunuSDK.Build.cs PublicDefinitions.Add($"USE_NUNU_SDK={(bUseNunuSDK ? "1" : "0")}");

Editor Integration

In the Editor, you can fully configure the SDK’s build behavior by going to Edit → Project Settings → Plugins → NunuSDK

Here you can configure:

  • Enable NunuSDK: Master toggle that enables or disables the SDK globally
  • Always Enable in Editor: When checked, the SDK will always be enabled when running in the Editor, regardless of build configuration
  • Enabled Build Configurations: Select which build configurations (Development, DebugGame, Debug, Test) should have the SDK enabled

These settings modify the Config/DefaultNunuSDK.ini file:

[/Script/NunuSDK.NunuSDKSettings] bEnableNunuSDK=True bAlwaysEnableInEditor=True EnabledBuildConfigurations=(Development,DebugGame,Debug,Test) ConsoleToggleChords=() AdditionalLibraryComponentClasses=()

Note: You most likely need to reload the project in your IDE to see the changes for the setting to take effect

Build Pipeline

For development builds, you can override the configuration using the USE_NUNU_SDK environment variable:

# Enable SDK for current session set USE_NUNU_SDK=1 # Disable SDK for current session set USE_NUNU_SDK=0

Set this environment variable before building the project.

Decision Logic

The SDK uses the following logic to determine whether it should be enabled:

  1. If the USE_NUNU_SDK environment variable is set, that value overrides all other settings
  2. Otherwise, if the global bEnableNunuSDK setting is False, the SDK is disabled
  3. If in Editor mode and bAlwaysEnableInEditor is True, the SDK is enabled
  4. If not in Editor mode, the SDK checks if the current build configuration is in the EnabledBuildConfigurations list
Note: The SDK is always force disabled in shipping targets
Last updated on