[libcxx-commits] [libcxx] [libcxx] Add cache file for the GPU build (PR #99348)
Joseph Huber via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 25 04:38:52 PDT 2024
================
@@ -0,0 +1,45 @@
+# Handle default arguments when done through the LLVM runtimes interface.
+foreach(target amdgcn-amd-amdhsa nvptx64-nvidia-cuda)
+ set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
+ set(RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_UNICODE OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_RTTI OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_THREADS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_MONOTONIC_CLOCK ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_INSTALL_LIBRARY ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_LIBC "llvm-libc" CACHE STRING "")
+ set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")
+endforeach()
+
+# Handle default arguments when being built directly.
+if(${CMAKE_CXX_COMPILER_TARGET} MATCHES "^amdgcn|^nvptx")
+ set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
+ set(LIBCXX_CXX_ABI none CACHE STRING "")
+ set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
+ set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_UNICODE OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_RTTI OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
+ set(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY ON CACHE BOOL "")
+ set(LIBCXX_ENABLE_THREADS OFF CACHE BOOL "")
+ set(LIBCXX_ENABLE_MONOTONIC_CLOCK ON CACHE BOOL "")
+ set(LIBCXX_INSTALL_LIBRARY ON CACHE BOOL "")
+ set(LIBCXX_LIBC "llvm-libc" CACHE STRING "")
+ set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+ set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")
+endif()
----------------
jhuber6 wrote:
I wanted this cache file to cover two cases.
1. `cmake ../llvm -C <cache> -DRUNTIMES_amdgcn-amd-amdsha_LLVM_ENABLE_RUNTIMES=libcxx`
2. `cmake ../runtimes -C <cache> -DLLVM_ENABLE_RUNTIMES=libcxx -DCMAKE_COMPILER_TARGET=amdgcn-amd-amdhsa`
If I did this unconditionally, then case (1) would cause these options to apply to the default runtime target, not just the GPU ones.
https://github.com/llvm/llvm-project/pull/99348
More information about the libcxx-commits
mailing list