Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Fix LLVM find package picking up system-wide libraries (#1866)
This change fixes LLVM find package ignoring the library path provided by LLVM_CONFIG and picking up a system-wide library instead. This happens when a custom LLVM is compiled statically, and there is a system-wide LLVM of the version which OSL expects. The solution is to pass NO_DEFAULT_PATH to the find_library so that the function only considers paths explicitly coming from the LLVM's configuration executable. It is a bit unclear what is the expected behavior of this module when LLVM_CONFIG is not available. It is possible to limit possible side effects of this change by only ignoring default paths if the LLVM CONFIG executable is found. In practice this issue happened in Blender's build environment where HIP is used for OpenImageDenoiser: HIP toolchain pulls in LLVM system wide. While it is not an issue on itself (as it is only a compile time dependency for HIP support in OIDN) in conflicts with the logic in the OSL's find_package(LLVM). Signed-off-by: Sergey Sharybin <[email protected]>
- Loading branch information