Skip to content

Addon project setup

insomniac_lemon edited this page Aug 6, 2024 · 1 revision

Directory layout goal:

  project
+ ├── addons
+ │   └── $projectname
+ │       ├── .gitignore
+ │       ├── config.nims # there are several items that must be set.
+ │       ├── $projectname.gdextension
+ │       ├── $projectname.nimble
+ │       ├── lib
+ │       │   └── $projectname # built shared object
+ │       └── src
+ │           ├── $projectname.nim # entry point of the project
+ │           └── $projectname
+ │               └── ...
  ├── .gitattributes
  ├── .gitignore
  ├── .godot
  ├── icon.svg
  ├── icon.svg.import
  └── project.godot
  # config.nims
+ --app: lib
+ --noMain: on
+ --define: nimPreviewDotLikeOps
  # $projectname.nimble
  srcDir        = "src"
  bin           = @["$projectname"]
+ binDir        = "lib"

  # Dependencies

  requires "nim >= 2.0.0"

+ requires "gdextcore"
+ requires "gdextgen"
+ requires "gdext"
#$projectname.gdextension

[configuration]

entry_symbol = "init_library"
compatibility_minimum = 4.1

[libraries]

linux.debug.x86_64 = "res://addons/$projectname/lib/$projectname"
linux.release.x86_64 = "res://addons/$projectname/lib/$projectname"
windows.debug.x86_64 = "res://addons/$projectname/lib/$projectname"
windows.release.x86_64 = "res://addons/$projectname/lib/$projectname"

Clone this wiki locally