summaryrefslogtreecommitdiff
path: root/libc/cmake
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-04-19 15:27:33 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-04-19 15:28:26 -0500
commit24214832fd433a901c2296088bf23b7bc86c6a96 (patch)
tree771252956d700f093af34376971652c0963eb77e /libc/cmake
parent59736ceb8d45ac2a0e7e8b67fa2e067c9f3070ef (diff)
downloadllvm-24214832fd433a901c2296088bf23b7bc86c6a96.tar.gz
[libc] Fix `nvptx_options` variable not being reset in CMake
Summary: This variable was not being reset, which caused the options to be compounded when building multiple architectures. This was very problematic as the architectures are not compatible.
Diffstat (limited to 'libc/cmake')
-rw-r--r--libc/cmake/modules/LLVMLibCObjectRules.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index 5a9fdc643f44..b62a799c7026 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -66,11 +66,12 @@ endfunction()
# Obtains NVPTX specific arguments for compilation.
# The PTX feature is primarily based on the CUDA toolchain version. We want to
-# be able to target NVPTX without an existing architecture, so we need to set
-# this manually. This simply sets the PTX feature to the minimum required for
-# the features we wish to use on that target.
+# be able to target NVPTX without an existing CUDA installation, so we need to
+# set this manually. This simply sets the PTX feature to the minimum required
+# for the features we wish to use on that target.
# Adjust as needed for desired PTX features.
function(get_nvptx_compile_options output_var gpu_arch)
+ set(nvptx_options "")
list(APPEND nvptx_options "-march=${gpu_arch}")
if(${gpu_arch} STREQUAL "sm_35")
list(APPEND nvptx_options "--cuda-feature=+ptx42")