# cmake: find LLVM libraries unambiguously · gitcafe/zig

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

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

Visibility: public

Requested revision: 5c441f7f8abe31f21e53169c05c8816d8b4c89e3

Requested commit: 5c441f7f8abe31f21e53169c05c8816d8b4c89e3

Commit: 5c441f7f8abe31f21e53169c05c8816d8b4c89e3

Tree: 02c9cfd4b376543470d4f0b22228f040094fa064

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
cmake: find LLVM libraries unambiguously

Before, we would end up with the LLVM_LIBRARIES variable containing,
for example, "-lLLVMAnalysis;-lz" and the Zig compiler CLI would be
stuck with ambiguous library names. In this branch, that ambiguity is
not allowed; it will look for a dynamically linked LLVMAnalysis and fail
to find it in the case that the build of LLVM is static.

With this change, LLVM_LIBRARIES will contain, for example,
"/full/path/to/libLLVMAnalysis.a;-lz" and it is unambiguous that the
first library should be linked statically and the second dynamically.

In the case of a dynamically linked system LLVM, it will look like
"/full/path/to/libLLVM.so;-lz" which again is fully unambiguous.

This fixes building Zig from source.

```

## Parents

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

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