Commit 2fd6b38
authored
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 <sergey@blender.org>1 parent df49a40 commit 2fd6b38
1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
103 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
115 | | - | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
0 commit comments