summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-02-23 07:30:53 -0600
committerJoseph Huber <huberjn@outlook.com>2024-02-23 07:32:03 -0600
commitb8a7d8131e5ad2c21238e192e6f9c5b69512abe3 (patch)
treed1748f1553717b3c9fc9dfd232823576ffb35f3d
parent492e8ba0384b038596e6b4a97313b7bdced5e868 (diff)
[LLVM] Fix incorrect GPU triple detection for runtimes builds
Summary: This block of code is used to prevent a GPU-based cross compiling build from taking incompatible arguments. However this incorrectly used the LLVM default triple instead of the runtimes target. Fix that so the bots can continue to default the triple to NVPTX.
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 40316b11ceed..08ff49ded57a 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -120,10 +120,10 @@ if( LLVM_ENABLE_ASSERTIONS )
endif()
endif()
-# If we are targeting a GPU architecture we want to ignore all the standard
-# flag handling.
-if("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^amdgcn" OR
- "${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^nvptx64")
+# If we are targeting a GPU architecture in a runtimes build we want to ignore
+# all the standard flag handling.
+if("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn" OR
+ "${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx64")
return()
endif()