[libc-commits] [libc] [libc][test] adds LINK_LIBRARIES pthread to pthreads test cmake (PR #89262)

Michael Flanders via libc-commits libc-commits at lists.llvm.org
Thu Apr 18 10:03:47 PDT 2024


https://github.com/Flandini updated https://github.com/llvm/llvm-project/pull/89262

>From 820fa520f78830c40edf6b0cf0a862b9e8973118 Mon Sep 17 00:00:00 2001
From: Michael Flanders <flanders.michaelk at gmail.com>
Date: Thu, 18 Apr 2024 09:32:51 -0700
Subject: [PATCH 1/2] adds LINK_LIBRARIES pthread to pthreads test cmake

---
 libc/test/src/pthread/CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libc/test/src/pthread/CMakeLists.txt b/libc/test/src/pthread/CMakeLists.txt
index 51954a5babd2c5..53a7a14f8d558c 100644
--- a/libc/test/src/pthread/CMakeLists.txt
+++ b/libc/test/src/pthread/CMakeLists.txt
@@ -19,6 +19,8 @@ add_libc_unittest(
     libc.src.pthread.pthread_attr_setguardsize
     libc.src.pthread.pthread_attr_setstacksize
     libc.src.pthread.pthread_attr_setstack
+  LINK_LIBRARIES
+    -lpthread
 )
 
 add_libc_unittest(
@@ -38,6 +40,8 @@ add_libc_unittest(
     libc.src.pthread.pthread_mutexattr_setpshared
     libc.src.pthread.pthread_mutexattr_setrobust
     libc.src.pthread.pthread_mutexattr_settype
+  LINK_LIBRARIES
+    -pthread
 )
 
 add_libc_unittest(
@@ -56,4 +60,6 @@ add_libc_unittest(
     libc.src.pthread.pthread_condattr_init
     libc.src.pthread.pthread_condattr_setclock
     libc.src.pthread.pthread_condattr_setpshared
+  LINK_LIBRARIES
+    -pthread
   )

>From 0ac39b0f9e7b9a557530618f929c42a48081b5d3 Mon Sep 17 00:00:00 2001
From: Michael Flanders <flanders.michaelk at gmail.com>
Date: Thu, 18 Apr 2024 10:03:34 -0700
Subject: [PATCH 2/2] remove extraneous linking of pthread in tests

---
 libc/test/src/pthread/CMakeLists.txt | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libc/test/src/pthread/CMakeLists.txt b/libc/test/src/pthread/CMakeLists.txt
index 53a7a14f8d558c..a9e7d91e6b426e 100644
--- a/libc/test/src/pthread/CMakeLists.txt
+++ b/libc/test/src/pthread/CMakeLists.txt
@@ -19,8 +19,6 @@ add_libc_unittest(
     libc.src.pthread.pthread_attr_setguardsize
     libc.src.pthread.pthread_attr_setstacksize
     libc.src.pthread.pthread_attr_setstack
-  LINK_LIBRARIES
-    -lpthread
 )
 
 add_libc_unittest(
@@ -40,8 +38,6 @@ add_libc_unittest(
     libc.src.pthread.pthread_mutexattr_setpshared
     libc.src.pthread.pthread_mutexattr_setrobust
     libc.src.pthread.pthread_mutexattr_settype
-  LINK_LIBRARIES
-    -pthread
 )
 
 add_libc_unittest(



More information about the libc-commits mailing list