# Per Module Compile Options and "-target name"

**URL:** <https://ziggit.dev/t/per-module-compile-options-and-target-name/4057>\
**Category:** Explain\
**Created:** [April 23, 2024, 3:13pm UTC](https://ziggit.dev/t/per-module-compile-options-and-target-name/4057 "2024-04-23T15:13:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mperillo](https://ziggit.dev/user_avatar/ziggit.dev/mperillo/32/1280_2.png) [@mperillo](https://ziggit.dev/u/mperillo)\
**Post date:** [April 23, 2024, 3:13pm UTC](https://ziggit.dev/t/per-module-compile-options-and-target-name/4057/1 "2024-04-23T15:13:09Z")

</div>

When the per module compile options was added, I assumed that the main use case was to mix module with different optimization.

However, after reading [std.Build: Install Windows DLLs to `\<prefix\>/bin/` by default · ziglang/zig@e8f28cd · GitHub](https://github.com/ziglang/zig/commit/e8f28cda9edb06a5f2189ca5e8928df52ddea20d), I found that you can also have different executable formats.

What is the use case of having different executable formats in a Zig package/distribution?

Thanks.

---

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [April 23, 2024, 7:04pm UTC](https://ziggit.dev/t/per-module-compile-options-and-target-name/4057/2 "2024-04-23T19:04:00Z")

</div>

I don’t know exactly, I would imagine if you have something like a console dev kit, where you have an application running on your machine, which loads a console/embedded program onto another device and runs it there?

---

<div class="post-metadata">

**Author:** ![dude\_the\_builder](https://ziggit.dev/user_avatar/ziggit.dev/dude_the_builder/32/557_2.png) [@dude\_the\_builder](https://ziggit.dev/u/dude_the_builder)\
**Post date:** [April 23, 2024, 8:23pm UTC](https://ziggit.dev/t/per-module-compile-options-and-target-name/4057/3 "2024-04-23T20:23:49Z")

</div>

I recently worked on a project where the main executable uses Linux’s io\_uring directly, so it only makes sense to build this type of module for a Linux target. However this main executable depends on several modules that generate code and data files. These can be built and run on any target, so you can build the entire project on a Mac for example where the code and data gen parts are built and run natively but then the final main executable program is built specifically for the Linux target.
