Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMake] Use llvm-config to locate Findzstd.cmake (apache#16032)
* [CMake] Fallback for finding static zstd library from the system LLVM17 now depends on `-lzstd` when the `--link-static` option is used. I.e: ``` $ llvm-config-16 --link-static --system-libs -lrt -ldl -lm -lz -ltinfo -lxml2 $ llvm-config-17 --link-static --system-libs -lrt -ldl -lm -lz -lzstd -ltinfo -lxml2 ``` The current cmake rules try to find a "Findzstd.cmake" file located within the project, although this doesn't seem to exist, resulting in a compilation error. This commit adds a fallback to search the system for libzstd.a incase a "Findzstd.cmake" is not found. The zstd library is already installed as part of: https://github.com/apache/tvm/pull/15799/files#diff-c2c0605a8fdd4f5600690a8c7b1ec769882426af1b0ed01e8aaa0814e3a8f5dbR48 Change-Id: I19ab168f92d23e98809851f948e2122345ed01f1 * Use llvm-config to locate Findzstd.cmake Use llvm-config to find the location of the "Find*.cmake" files and add this location to the cmake `CMAKE_MODULE_PATH` variable. This allows the build to discover "Findzstd.cmake". Change-Id: I3d25074fad3b2b8fa4c3d47e0e4c0b27d8739c65
- Loading branch information