authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-09-23 20:59:09+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-09-23 20:59:09+02:00
log0fcee6e11c1b9b9de700cb2af4125237a51f5608
tree8260e151cb749dca7c90514aa18070141ba44fbd
parent58ee5f4e61cd9b7a9ba65798e2214efa3753a733
parent94024a9fae6e9292770fa377fe2a03b6b85b4249
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #6373 from notCalle/workaround-6087

Workaround MacOS build failure due to #6087

2 files changed, 11 insertions(+), 0 deletions(-)

CMakeLists.txt+6
...@@ -56,6 +56,7 @@ set(ZIG_PREFER_CLANG_CPP_DYLIB off CACHE BOOL "Try to link against -lclang-cpp")...@@ -56,6 +56,7 @@ set(ZIG_PREFER_CLANG_CPP_DYLIB off CACHE BOOL "Try to link against -lclang-cpp")
56set(ZIG_WORKAROUND_4799 off CACHE BOOL "workaround for https://github.com/ziglang/zig/issues/4799")56set(ZIG_WORKAROUND_4799 off CACHE BOOL "workaround for https://github.com/ziglang/zig/issues/4799")
57set(ZIG_WORKAROUND_POLLY_SO off CACHE STRING "workaround for https://github.com/ziglang/zig/issues/4799")57set(ZIG_WORKAROUND_POLLY_SO off CACHE STRING "workaround for https://github.com/ziglang/zig/issues/4799")
58set(ZIG_USE_CCACHE off CACHE BOOL "Use ccache if available")58set(ZIG_USE_CCACHE off CACHE BOOL "Use ccache if available")
59set(ZIG_WORKAROUND_6087 off CACHE BOOL "workaround for https://github.com/ziglang/zig/issues/6087")
5960
60if(CCACHE_PROGRAM AND ZIG_USE_CCACHE)61if(CCACHE_PROGRAM AND ZIG_USE_CCACHE)
61 SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")62 SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
...@@ -90,6 +91,11 @@ if(APPLE AND ZIG_STATIC)...@@ -90,6 +91,11 @@ if(APPLE AND ZIG_STATIC)
90 list(APPEND LLVM_LIBRARIES "${ZLIB}")91 list(APPEND LLVM_LIBRARIES "${ZLIB}")
91endif()92endif()
9293
94if(APPLE AND ZIG_WORKAROUND_6087)
95 list(REMOVE_ITEM LLVM_LIBRARIES "-llibxml2.tbd")
96 list(APPEND LLVM_LIBRARIES "-lxml2")
97endif()
98
93if(APPLE AND ZIG_WORKAROUND_4799)99if(APPLE AND ZIG_WORKAROUND_4799)
94 # eg: ${CMAKE_PREFIX_PATH} could be /usr/local/opt/llvm/100 # eg: ${CMAKE_PREFIX_PATH} could be /usr/local/opt/llvm/
95 list(APPEND LLVM_LIBRARIES "-Wl,${CMAKE_PREFIX_PATH}/lib/libPolly.a" "-Wl,${CMAKE_PREFIX_PATH}/lib/libPollyPPCG.a" "-Wl,${CMAKE_PREFIX_PATH}/lib/libPollyISL.a")101 list(APPEND LLVM_LIBRARIES "-Wl,${CMAKE_PREFIX_PATH}/lib/libPolly.a" "-Wl,${CMAKE_PREFIX_PATH}/lib/libPollyPPCG.a" "-Wl,${CMAKE_PREFIX_PATH}/lib/libPollyISL.a")
README.md+5
...@@ -73,6 +73,11 @@ in which case try `-DZIG_WORKAROUND_4799=ON`...@@ -73,6 +73,11 @@ in which case try `-DZIG_WORKAROUND_4799=ON`
7373
74Hopefully this will be fixed upstream with LLVM 10.0.1.74Hopefully this will be fixed upstream with LLVM 10.0.1.
7575
76Building with LLVM 10.0.1 you might run into this problem:
77`ld: library not found for -llibxml2.tbd`
78[Building with LLVM 10.0.1 installed via Homebrew fails](https://github.com/ziglang/zig/issues/6087),
79in which case you can try `-DZIG_WORKAROUND_6087=ON`.
80
76##### Windows81##### Windows
7782
78See https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows83See https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows