| ... | ... | @@ -53,6 +53,7 @@ set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not com |
| 53 | 53 | set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries") |
| 54 | 54 | set(ZIG_ENABLE_MEM_PROFILE off CACHE BOOL "Activate memory usage instrumentation") |
| 55 | 55 | set(ZIG_PREFER_CLANG_CPP_DYLIB off CACHE BOOL "Try to link against -lclang-cpp") |
| 56 | set(ZIG_WORKAROUND_4799 off CACHE BOOL "workaround for https://github.com/ziglang/zig/issues/4799") |
| 56 | 57 | set(ZIG_USE_CCACHE off CACHE BOOL "Use ccache if available") |
| 57 | 58 | |
| 58 | 59 | if(CCACHE_PROGRAM AND ZIG_USE_CCACHE) |
| ... | ... | @@ -88,6 +89,11 @@ if(APPLE AND ZIG_STATIC) |
| 88 | 89 | list(APPEND LLVM_LIBRARIES "${ZLIB}") |
| 89 | 90 | endif() |
| 90 | 91 | |
| 92 | if(APPLE AND ZIG_WORKAROUND_4799) |
| 93 | # eg: ${CMAKE_PREFIX_PATH} could be /usr/local/opt/llvm/ |
| 94 | 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") |
| 95 | endif() |
| 96 | |
| 91 | 97 | set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp") |
| 92 | 98 | |
| 93 | 99 | # Handle multi-config builds and place each into a common lib. The VS generator |
| ... | ... | @@ -397,6 +403,7 @@ add_library(zig_cpp STATIC ${ZIG_CPP_SOURCES}) |
| 397 | 403 | set_target_properties(zig_cpp PROPERTIES |
| 398 | 404 | COMPILE_FLAGS ${EXE_CFLAGS} |
| 399 | 405 | ) |
| 406 | |
| 400 | 407 | target_link_libraries(zig_cpp LINK_PUBLIC |
| 401 | 408 | ${CLANG_LIBRARIES} |
| 402 | 409 | ${LLD_LIBRARIES} |