Skip to main content
Version: v0.17.0-beta

Linking

Amethyst supports linking prebuilt data packs into your project. This allows people to share data packs as packages for others to consume.

warning

Unless you can control the file names of the data packs, assume that the load order is random.

Dynamic Linking​

Dynamic linking is when you include symbols from another data pack in yours, but the client still needs to install it separately. An example of this is an optional dependency.

Data packs can be dynamically linked with the -I or --include flag:

amethyst compile main.ame -I lib.zip -I lib2.zip -o output.zip

If running separately with amethyst run, make sure to also include the dynamic dependencies:

amethyst run lib.zip lib2.zip output.zip

Static Linking​

Static linking merges data packs together into one final output. This is the default method for handling dependencies in shards.

Data packs can be dynamically linked with the -L or --link flag:

amethyst compile main.ame -L lib.zip -L lib2.zip -o output.zip

Symbols linked from external libraries are exported in the final data pack.

Amethyst ABI​

In every data pack, Amethyst generates a .d.ame file which contains definitions for all of the exported symbols. The compiler simply loads this file to import them.