graphics/openshadinglanguage: unbreak build with llvm14 (+)

LLVM14 bundle have moved TargetRegistry.h from Support to MC subdir

Obtained from:	upstream
Approved by:	portmgr blanket
This commit is contained in:
Dima Panov 2022-05-28 15:51:29 +03:00
parent 39b1d22a22
commit 845dc5c968

View File

@ -0,0 +1,29 @@
diff --git src/build-scripts/build_llvm.bash src/build-scripts/build_llvm.bash
index 2e8f49fca..3b375e543 100755
--- src/build-scripts/build_llvm.bash
+++ src/build-scripts/build_llvm.bash
@@ -29,7 +29,7 @@ if [[ `uname` == "Linux" ]] ; then
fi
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
echo LLVMTAR = $LLVMTAR
- if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] ; then
+ if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] || [[ "$LLVM_VERSION" == "13.0.0" ]] || [[ "$LLVM_VERSION" == "14.0.0" ]] || [[ "$LLVM_VERSION" == "14.0.1" ]] ; then
# new
curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
else
diff --git src/liboslexec/llvm_util.cpp src/liboslexec/llvm_util.cpp
index b30c89318..22d4134ba 100644
--- src/liboslexec/llvm_util.cpp
+++ src/liboslexec/llvm_util.cpp
@@ -45,7 +45,11 @@
#include <llvm/Support/raw_os_ostream.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/ValueSymbolTable.h>
+#if OSL_LLVM_VERSION < 140
#include <llvm/Support/TargetRegistry.h>
+#else
+#include <llvm/MC/TargetRegistry.h>
+#endif
#include <llvm/Bitcode/BitcodeReader.h>
#include <llvm/Bitcode/BitcodeWriter.h>