-
Notifications
You must be signed in to change notification settings - Fork 2
user_cli_docs
extgen is a schema-driven code generator for GameMaker native extensions. It generates language bindings, platform glue code, and CMake build systems for all supported GameMaker targets from a single IDL input.
This document explains how to use extgen, how to configure it, and what each option does.
extgen takes a GMIDL schema (.gmidl, .json, etc.) and produces:
- C++ native bindings
- GML bindings
- Platform glue code (Android, iOS, consoles, etc.)
- A complete CMake project
- Optional documentation
Everything is controlled through a JSON configuration file validated by a generated JSON Schema.
If the schema validates, extgen will run.
extgen --config path/to/config.jsonextgen --init path/to/folderThis creates:
config.jsonextgen.schema.json
The config file automatically references the schema for editor validation and auto-completion.
When you run:
extgen --init ./my-extensionextgen will:
- ๐งพ Generate a JSON Schema describing all supported options
- ๐ Create a minimal
config.json - ๐ Automatically set the
$schemaproperty
You can immediately open config.json in any schema-aware editor
(VS Code recommended).
A simplified configuration file looks like this:
{
"$schema": "./extgen.schema.json",
"input": "./api.gmidl",
"root": "./",
"profile": "Full",
"gamemaker": { ... },
"targets": { ... },
"build": { ... },
"extras": { ... }
}| Field | Description |
|---|---|
$schema |
Path to the JSON schema (auto-managed) |
input |
Path to the GMIDL input file |
root |
Root output directory |
profile |
Controls what extgen emits |
gamemaker |
GameMaker artifacts configuration |
targets |
Platform targets |
build |
CMake & build settings |
extras |
Optional generators (docs, etc.) |
The profile field controls what categories of output are generated.
"profile": "Full"| Profile | Meaning |
|---|---|
Full |
Emit bindings + native code + build system |
BindingsOnly |
Emit GML / language bindings only |
BuildOnly |
Emit only CMake & build files |
This allows workflows like:
- ๐ Updating bindings without touching native code
- ๐๏ธ Regenerating build files only
Controls all GameMaker-related outputs. This is split into four independent generators:
-
wrappersโ generated GML API wrappers (what your game calls) -
runtimeโ runtime support (GMExtensionCore support code) -
yyโ.yygeneration or patching (function declarations + extension metadata integration) -
injectorsโ optional integration helpers (project/asset injection outputs)
Example:
"gamemaker": {
"wrappers": {
"enabled": true,
"outputFile": "extension.gml"
},
"runtime": {
"enabled": true,
"outputFile": "ext_runtime.gml"
},
"yy": {
"enabled": true,
"outputFile": "./declarations.yy",
"mode": "patch",
"extensionName": "OperaAds",
"extensionFileName": "OperaAds.yy",
"patchFrameworks": true
},
"injectors": {
"enabled": false,
"outputFolder": "./injectors"
}
}Generated GML wrapper API (the functions your GML code calls).
| Field | Description |
|---|---|
enabled |
Enable wrapper generation |
outputFile |
Output .gml file path |
Important
extgen does not create GameMaker IDE assets.
wrappers.outputFile should point to an existing .gml script asset in your extension (or a path you manage as part of your build/export flow).
Emits the runtime support code required by generated wrappers (GMExtensionCore support functions).
| Field | Description |
|---|---|
enabled |
Enable runtime emission |
outputFile |
Output .gml file path |
Note
This is the support layer used by the generated bindings (often referred to as the official GMExtensionCore).
Controls generation/patching of .yy content related to your extensionโs function declarations and metadata.
| Field | Description |
|---|---|
enabled |
Enable .yy generation/patching |
outputFile |
Output path for the generated .yy (or patch output) |
mode (required)
|
"plain" or "patch"
|
extensionName |
Optional extension display name (used by patch mode) |
extensionFileName |
Optional extension .yy filename (used by patch mode) |
patchFrameworks |
When patching, also patch iOS/tvOS frameworks/link settings where applicable |
-
plainProduces a standalone.yysnippet/output which you can append/merge manually. -
patchProduces an updated extension.yyby patching the target file (recommended for automation).
Important
If you use patch mode, you should treat the extension .yy as build-managed output.
This keeps function declarations in sync with GMIDL without manual edits.
Optional output for integration helpers.
| Field | Description |
|---|---|
enabled |
Enable injector output generation |
outputFolder |
Folder to write injector scripts/files |
Important
This should be enabled if your extension needs to target GMRT.
All native output is target-driven. Each enabled target activates platform-specific emitters and build presets.
| Field | Description |
|---|---|
enabled |
Enable this platform |
outputFolder |
Where the final binary is copied |
"windows": {
"enabled": true,
"outputFolder": "../"
}These targets:
- Require C++
- Emit shared libraries
- Generate CMake presets automatically
"android": {
"enabled": true,
"mode": "jni",
"outputFolder": "../AndroidSource"
}| Mode | Description |
|---|---|
java |
Java bridge (source only) |
kotlin |
Kotlin bridge (source only) |
jni |
Pure JNI (C++ native bindings) |
Note
-
jnimode requires C++ bindings -
javaandkotlinmodes generate source only (no native build presets)
"ios": {
"enabled": true,
"mode": "native",
"sourceFolder": "./ios",
"sourceFilename": "{0}_ios",
"outputFolder": "../iOSSourceFromMac"
}| Mode | Description |
|---|---|
objc |
Objective-C bridge |
swift |
Swift bridge |
native |
Obj-C wrapper over C++ native core |
Note
native mode requires C++ bindings.
Supported consoles:
- Xbox
- PlayStation 4
- PlayStation 5
- Nintendo Switch
Example:
"ps5": {
"enabled": true,
"outputFolder": "../"
}"switch": {
"enabled": true,
"vcTargetsPath": "path/to/MSBuild/folder",
"outputFolder": "../"
}Important
-
vcTargetsPathis required - extgen does not ship any SDK files
- You must provide your own path from the Nintendo SDK
Controls CMake generation.
"build": {
"emitCmake": true,
"cmake": {
"cppStandard": 20,
"cppExtensions": false,
"strictWarnings": true,
"useThirdParty": true,
"emitPresets": true
}
}| Field | Description |
|---|---|
emitCmake |
Generate CMakeLists.txt
|
cppStandard |
C++ standard (e.g. 17, 20) |
cppExtensions |
Allow compiler extensions |
strictWarnings |
Enable strict compiler warnings |
useThirdParty |
Include third_party directory |
emitPresets |
Generate CMakePresets.json
|
"extras": {
"docs": {
"enabled": true,
"outputFolder": "./docs",
"outputFileName": "documentation.json",
"overwrite": true
}
}Generates intermediate documentation data that can be consumed by other tools to produce final user-facing documentation.
All paths:
- May be relative or absolute
-
rootis resolved relative to the config file - All other paths are resolved relative to
root - Support environment variables
- Support
~on Unix systems
extgen --config config.json"profile": "BindingsOnly""profile": "BuildOnly"{
"input": "./api.gmidl",
"root": "./",
"profile": "Full",
"gml": { "enabled": true },
"targets": {
"windows": { "enabled": true },
"android": { "enabled": true, "mode": "jni" }
},
"build": { "emitCmake": true }
}- extgen is target-driven, not language-driven
- C++ is emitted automatically only when required
- The JSON Schema is the source of truth
- If the schema validates, extgen will run โ
GameMaker 2026