[libc-commits] [libc] [libc] fix riscv atomic test build (PR #119008)

via libc-commits libc-commits at lists.llvm.org
Fri Dec 6 10:53:55 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/119008.diff


1 Files Affected:

- (modified) libc/test/src/__support/CPP/CMakeLists.txt (+12) 


``````````diff
diff --git a/libc/test/src/__support/CPP/CMakeLists.txt b/libc/test/src/__support/CPP/CMakeLists.txt
index 2b4d6107b767d3..36757112525719 100644
--- a/libc/test/src/__support/CPP/CMakeLists.txt
+++ b/libc/test/src/__support/CPP/CMakeLists.txt
@@ -108,6 +108,18 @@ if(NOT LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
   )
 endif()
 
+get_fq_target_name(atomic_test fq_atomic_test)
+if (LIBC_TARGET_ARCHITECTURE STREQUAL "riscv")
+  if (TARGET ${fq_atomic_test}.__unit__)
+    message(STATUS "adding atomic library to ${fq_atomic_test}.__unit__")
+    target_link_libraries(${fq_atomic_test}.__unit__ PUBLIC atomic)
+  endif()
+  if (TARGET ${fq_atomic_test}.__hermetic__)
+    message(STATUS "adding atomic library to ${fq_atomic_test}.__hermetic__")
+    target_link_libraries(${fq_atomic_test}.__unit__ PUBLIC atomic)
+  endif()
+endif()
+
 add_libc_test(
   stringstream_test
   SUITE

``````````

</details>


https://github.com/llvm/llvm-project/pull/119008


More information about the libc-commits mailing list