# Ammer and Anvil: Haxe Native Extension Toolkit

**URL:** <https://community.haxe.org/t/ammer-and-anvil-haxe-native-extension-toolkit/2298>\
**Category:** Showcase\
**Created:** [March 6, 2020, 12:03pm UTC](https://community.haxe.org/t/ammer-and-anvil-haxe-native-extension-toolkit/2298 "2020-03-06T12:03:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![piboistudios](https://community.haxe.org/user_avatar/community.haxe.org/piboistudios/32/361_2.png) [@piboistudios](https://community.haxe.org/u/piboistudios)\
**Post date:** [March 6, 2020, 12:03pm UTC](https://community.haxe.org/t/ammer-and-anvil-haxe-native-extension-toolkit/2298/1 "2020-03-06T12:03:31Z")

</div>

In case anyone else has had their attention drawn to @Aurel300’s [`ammer`](https://github.com/aurel300/ammer) library, I’ve put together a class you can call from an initialization macro that works quite well for Windows.

I haven’t tested for other platforms, but presumably, if the build process works on your platform, it will work for others on the same platform (see [#30](https://github.com/Aurel300/ammer/issues/30)).

If you’re a library author, and you want to distribute native extensions built with `ammer`, you should try [`anvil`](https://github.com/piboistudios/anvil).

Both projects are both at version 0.0.1, hopefully that answers any questions about production readiness 🙂

But, it works quite well, and I’ve gotten it to work on two different rigs of very different calibers so I’m optimistic.

`ammer` will build your stub code provided some preconditions are met (the native library the stub code relies on has been built and is in a place that is accessible to the user’s output directory).

`anvil` essentially takes care of those preconditions by asking 3 questions:

- What’s your native library called (what does `ammer` know it as)
- Where’s your native library located (relative to the project root directory)
- What build command will you run (usually you will include a `Makefile` or a `CMakeLists.txt` and use something like `nmake` or `cmake`)

What `anvil` does not do:

- Create `Makefiles` or `CMakeLists.txt` (or in any way reason about how to build the c files, it simply runs a command, that command should produce binaries, whatever restrictions that may come with for the user, in my case, you have to be using Windows and you need the MSVC toolchain)
- Facilitate any cross-platform usage of an `ammer` library: If the native extension isn’t cross-platform, anvil won’t change that.

---

_[View the full topic](https://community.haxe.org/t/ammer-and-anvil-haxe-native-extension-toolkit/2298)._
