aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-04-06 15:42:04 -0400
committerAndrew Kelley <andrew@ziglang.org>2020-04-06 18:38:09 -0400
commit15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868 (patch)
tree5f428ae890f41eed431234d3007ed44a56fc080c /cmake
parentafa24ccd993e38b56407c83160da567bc2b0ae8a (diff)
downloadzig-15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868.tar.gz
zig-15ab61b2a00b56c5b15a2d5a4efbf6b7bde7a868.zip
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.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Findllvm.cmake5
1 files changed, 1 insertions, 4 deletions
diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake
index 6819c23ee5..12e1ff7eb0 100644
--- a/cmake/Findllvm.cmake
+++ b/cmake/Findllvm.cmake
@@ -144,9 +144,7 @@ else()
/mingw64/lib
/c/msys64/mingw64/lib
c:\\msys64\\mingw64\\lib)
- if(LLVM_${_prettylibname_}_LIB)
- set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_${_prettylibname_}_LIB})
- endif()
+ set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_${_prettylibname_}_LIB})
endmacro(FIND_AND_ADD_LLVM_LIB)
# This list can be re-generated with `llvm-config --libfiles` and then
@@ -154,7 +152,6 @@ else()
# `llvm-config` here because we are cross compiling.
FIND_AND_ADD_LLVM_LIB(LLVMXRay)
FIND_AND_ADD_LLVM_LIB(LLVMWindowsManifest)
- FIND_AND_ADD_LLVM_LIB(LLVMTableGen)
FIND_AND_ADD_LLVM_LIB(LLVMSymbolize)
FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoPDB)
FIND_AND_ADD_LLVM_LIB(LLVMOrcJIT)