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