| ... | ... | @@ -89,11 +89,9 @@ endif() |
| 89 | 89 | |
| 90 | 90 | set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)") |
| 91 | 91 | set(ZIG_SHARED_LLVM off CACHE BOOL "Prefer linking against shared LLVM libraries") |
| 92 | | set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries") |
| 93 | | set(ZIG_STATIC_ZLIB off CACHE BOOL "Prefer linking against static zlib") |
| 94 | | set(ZIG_ENABLE_ZSTD on CACHE BOOL "Enable linking zstd") |
| 95 | | set(ZIG_ENABLE_LIBCPP on CACHE BOOL "Enable linking libcpp") |
| 96 | | set(ZIG_STATIC_ZSTD off CACHE BOOL "Prefer linking against static zstd") |
| 92 | set(ZIG_STATIC_LLVM ${ZIG_STATIC} CACHE BOOL "Prefer linking against static LLVM libraries") |
| 93 | set(ZIG_STATIC_ZLIB ${ZIG_STATIC} CACHE BOOL "Prefer linking against static zlib") |
| 94 | set(ZIG_STATIC_ZSTD ${ZIG_STATIC} CACHE BOOL "Prefer linking against static zstd") |
| 97 | 95 | set(ZIG_USE_CCACHE off CACHE BOOL "Use ccache") |
| 98 | 96 | |
| 99 | 97 | if(ZIG_USE_CCACHE) |
| ... | ... | @@ -105,12 +103,6 @@ if(ZIG_USE_CCACHE) |
| 105 | 103 | endif() |
| 106 | 104 | endif() |
| 107 | 105 | |
| 108 | | if(ZIG_STATIC) |
| 109 | | set(ZIG_STATIC_LLVM ON) |
| 110 | | set(ZIG_STATIC_ZLIB ON) |
| 111 | | set(ZIG_STATIC_ZSTD ON) |
| 112 | | endif() |
| 113 | | |
| 114 | 106 | if (ZIG_SHARED_LLVM AND ZIG_STATIC_LLVM) |
| 115 | 107 | message(SEND_ERROR "-DZIG_SHARED_LLVM and -DZIG_STATIC_LLVM cannot both be enabled simultaneously") |
| 116 | 108 | endif() |
| ... | ... | @@ -150,8 +142,13 @@ if(ZIG_STATIC_ZLIB) |
| 150 | 142 | list(APPEND LLVM_LIBRARIES "${ZLIB}") |
| 151 | 143 | endif() |
| 152 | 144 | |
| 153 | | if(ZIG_STATIC_ZSTD AND ZIG_ENABLE_ZSTD) |
| 154 | | list(REMOVE_ITEM LLVM_SYSTEM_LIBRARIES "-lzstd") |
| 145 | if(ZIG_STATIC_ZSTD) |
| 146 | if (MSVC) |
| 147 | list(REMOVE_ITEM LLVM_SYSTEM_LIBRARIES "zstd.lib") |
| 148 | else() |
| 149 | list(REMOVE_ITEM LLVM_SYSTEM_LIBRARIES "-lzstd") |
| 150 | endif() |
| 151 | |
| 155 | 152 | find_library(ZSTD NAMES libzstd.a libzstdstatic.a zstd NAMES_PER_DIR) |
| 156 | 153 | list(APPEND LLVM_LIBRARIES "${ZSTD}") |
| 157 | 154 | endif() |