# rc compilation: Use MSVC includes if present, fallback to mingw · gitcafe/zig

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

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

Visibility: public

Requested revision: 0168ed7bf1c7fc5010fa82eaf33ed1b3af817709

Requested commit: 0168ed7bf1c7fc5010fa82eaf33ed1b3af817709

Commit: 0168ed7bf1c7fc5010fa82eaf33ed1b3af817709

Tree: 8b5491dde63f2cae8a53db61f1a6be777cb19fa8

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
rc compilation: Use MSVC includes if present, fallback to mingw

The include directories used when preprocessing .rc files are now separate from the target, and by default will use the system MSVC include paths if the MSVC + Windows SDK are present, otherwise it will fall back to the MinGW includes distributed with Zig. This default behavior can be overridden by the `-rcincludes` option (possible values: any (the default), msvc, gnu, or none).

This behavior is useful because Windows resource files may `#include` files that only exist with in the MSVC include dirs (e.g. in `<MSVC install directory>/atlmfc/include` which can contain other .rc files, images, icons, cursors, etc). So, by defaulting to the `any` behavior (MSVC if present, MinGW fallback), users will by default get behavior that is most-likely-to-work.

It also should be okay that the include directories used when compiling .rc files differ from the include directories used when compiling the main binary, since the .res format is not dependent on anything ABI-related. The only relevant differences would be things like `#define` constants being different values in the MinGW headers vs the MSVC headers, but any such differences would likely be a MinGW bug.

```

## Parents

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

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