llvm
128b1395 - [SYCL] Fix zstd build when static zstd libraries are not found (#15856)

Commit
1 year ago
[SYCL] Fix zstd build when static zstd libraries are not found (#15856) **Problem:** When we use `LLVM_ENABLE_ZSTD=ON` along with `LLVM_USE_STATIC_ZSTD=ON`, LLVM config fails with the following error when libzstd.a is not found but libzstd.so is found: ``` CMake Error at lib/Support/CMakeLists.txt:327 (get_property): get_property could not find TARGET zstd::libzstd_static. Perhaps it has not yet been created. CMake Error at lib/Support/CMakeLists.txt:330 (get_property): get_property could not find TARGET zstd::libzstd_static. Perhaps it has not yet been created. ``` The bug is in upstream and in the following lines: https://github.com/intel/llvm/blob/sycl/llvm/lib/Support/CMakeLists.txt#L32 - In the `else()`, the code just assumes that static libraries are available. **Solution:** When user specifies `LLVM_USE_STATIC_ZSTD=ON`, we should enable ZSTD only if static zstd library is present. Otherwise, the build should just proceed normally since zstd is optional, even in upstream.
Author
Parents
Loading