aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-07-15 18:51:41 -0700
committerCody Tapscott <topolarity@tapscott.me>2022-07-23 08:52:30 -0700
commit3f640ef3d20db848a4d38299cb66db8a3c14b3b1 (patch)
tree609b61c97b9a96a8dbcf7160cb73513c497d8b76 /src/codegen/c.zig
parent460211431f407c9f707e3ac3bbff61610a487926 (diff)
downloadzig-3f640ef3d20db848a4d38299cb66db8a3c14b3b1.tar.gz
zig-3f640ef3d20db848a4d38299cb66db8a3c14b3b1.zip
CMake: Improve usage of `llvm-config`, esp. for consistent linking
This commit reworks the LLVM/Clang/LLD discovery process for CMake. The biggest changes are that: 1. We search for LLVM from most preferred directory to least, skipping any `llvm-config` that is the wrong version, or that doesn't support the requested link mode ("static" or "shared"). 2. `ZIG_PREFER_CLANG_CPP_DYLIB` has been renamed to `ZIG_SHARED_LLVM`, to better align with `ZIG_STATIC_LLVM`. 3. We only search for LLVM in the same directory alongside LLVM. 4. LLVM's link mode is forwarded to Clang, so that we can look for the appropriate shared/static libraries. 5. We use `--link-static` when querying `--system-libs` from llvm-config, so that this will include libz and other dependencies for statically linking LLD
Diffstat (limited to 'src/codegen/c.zig')
0 files changed, 0 insertions, 0 deletions