You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmake: Fix using spirv-tools package on Ubuntu 22.04
When using the `spirv-tools` system package on Ubuntu 20.04 the
`SPIRV-Tools-shared` CMake target, which represents
`/usr/lib/x86_64-linux-gnu/libSPIRV-Tools.so`, is imported and used for
linking and include directories. However, on Ubuntu 22.04 it does not
exist which results in the following error:
```
CMake Error at /builds/SPIRV-LLVM-Translator/CMakeLists.txt:124 (get_target_property):
get_target_property() called with non-existent target "SPIRV-Tools-shared".
```
Instead, on Ubuntu 22.04 the `SPIRV-Tools-static` CMake target is
imported, which represents `/usr/lib/x86_64-linux-gnu/libSPIRV-Tools.a`,
which suggests the project or package maintainers changed the default
library type being compiled.
This patch updates the `CMakeLists.txt` to check if either of these
targets exists, preferring the shared library, before attempting to get
properties from the target or use it as a link library. If neither
target exists it is treated as a fatal error.
0 commit comments