# cmake: improvements to cross-compiling for Windows · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868

Requested commit: 15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868

Commit: 15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868

Tree: 5f428ae890f41eed431234d3007ed44a56fc080c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
cmake: improvements to cross-compiling for Windows

 * don't unconditionally pass -lz3 for mingw builds. If mingw builds
   require this then the llvm-config executable should put it as part of
   --system-libs. If there is a bug and it does not do that, and we need
   a workaround, then the workaround should be an explicit cmake option.
 * don't link libstage2.a against -lntdll. This causes zig to set
   `builtin.link_mode == .Dynamic` and include the TLS definitions,
   which then collide with the mingw-w64 symbols. This should probably
   be addressed separately, but for now this solves the problem and
   there is no reason to link a static library against a DLL.
 * Findllvm.cmake no longer treats the libraries as "optional" and will
   emit a cmake error if one is not found. Additionally, the
   not-required LLVM library LLVMTableGen is omitted.

```

## Parents

- [afa24ccd993e38b56407c83160da567bc2b0ae8a](https://git.cafe/gitcafe/zig/commit/afa24ccd993e38b56407c83160da567bc2b0ae8a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868?format=markdown)
