| author | |
| committer | |
| log | e857190dab2f1575dc3092f91bfb7fca5583b996 |
| tree | 3d7a195693e79d55dfabc8632a34b6427d09b193 |
| parent | aaf99371b22e816a4162391d799b9d22bba21120 |
Without this, building from source caused:
CommandLine Error: Option 'mc-relax-all' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
This is due to LLVM static libs compiled in multiple times. But without
the LLVM static libs on the linker line, it caused undefined symbol
linker errors.
So our hands are tied. Homebrew users will have to specify
`-DZIG_PREFER_CLANG_CPP_DYLIB`.2 files changed, 2 insertions(+), 1 deletions(-)
CMakeLists.txt+1| ... | @@ -46,6 +46,7 @@ message("Configuring zig version ${ZIG_VERSION}") | ... | @@ -46,6 +46,7 @@ message("Configuring zig version ${ZIG_VERSION}") |
| 46 | set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)") | 46 | set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)") |
| 47 | set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries") | 47 | set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries") |
| 48 | set(ZIG_ENABLE_MEM_PROFILE off CACHE BOOL "Activate memory usage instrumentation") | 48 | set(ZIG_ENABLE_MEM_PROFILE off CACHE BOOL "Activate memory usage instrumentation") |
| 49 | set(ZIG_PREFER_CLANG_CPP_DYLIB off CACHE BOOL "Try to link against -lclang-cpp") | ||
| 49 | 50 | ||
| 50 | if(ZIG_STATIC) | 51 | if(ZIG_STATIC) |
| 51 | set(ZIG_STATIC_LLVM "on") | 52 | set(ZIG_STATIC_LLVM "on") |
cmake/Findclang.cmake+1-1| ... | @@ -17,7 +17,7 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h | ... | @@ -17,7 +17,7 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h |
| 17 | /mingw64/include | 17 | /mingw64/include |
| 18 | ) | 18 | ) |
| 19 | 19 | ||
| 20 | if(NOT ZIG_STATIC_LLVM) | 20 | if(ZIG_PREFER_CLANG_CPP_DYLIB) |
| 21 | find_library(CLANG_CPP_DYLIB | 21 | find_library(CLANG_CPP_DYLIB |
| 22 | NAMES | 22 | NAMES |
| 23 | clang-cpp-10.0 | 23 | clang-cpp-10.0 |