# CMake: refactor "zigcpp" target logic · gitcafe/zig

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

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

Visibility: public

Requested revision: 1f7ca6b2dfca66032342c82ec25ae28e6ec02e21

Requested commit: 1f7ca6b2dfca66032342c82ec25ae28e6ec02e21

Commit: 1f7ca6b2dfca66032342c82ec25ae28e6ec02e21

Tree: 218f87e2d8b87bed9576c178d02148b880bca222

Author: Eric Joldasov

Committer: Eric Joldasov

## Message

```
CMake: refactor "zigcpp" target logic

* Localize most of the global properties and functions, for some time
  they are only needed for "zigcpp" static library (sometimes with PUBLIC
  keyword, so that it will propagate to zig2): `CMAKE_*_OUTPUT_DIRECTORY`
  and two calls to `include_directories`. This removes useless flags when
  building other targets and cleans build log a bit.
* Remove `EXE_CXX_FLAGS` variable, instead use more appropriate specific
  properties and functions for this target. This gives better errors if
  compiler does not support some of them, and CMake also handles for us
  duplicate flags. It's also easier to read side-by-side with same
  flags from build.zig .
* Add some comments.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>

```

## Parents

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

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