From f0e608de27b3d568000046eebf3712ab542979d6 Mon Sep 17 00:00:00 2001 From: Siva Chandra Reddy Date: Wed, 15 Jun 2022 07:11:57 +0000 Subject: [PATCH] [libc] Add linux threads targets only if __support/OSUtil targets are available. --- libc/src/__support/CMakeLists.txt | 9 +++++---- libc/src/__support/threads/linux/CMakeLists.txt | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt index 284d4ae..24c6372 100644 --- a/libc/src/__support/CMakeLists.txt +++ b/libc/src/__support/CMakeLists.txt @@ -60,10 +60,11 @@ add_header_library( arg_list.h ) -# Thread support is used by other support libraries. So, we add the "threads" -# before other directories. +add_subdirectory(FPUtil) +add_subdirectory(OSUtil) + +# Thread support is used by other "File". So, we add the "threads" +# before "File". add_subdirectory(threads) add_subdirectory(File) -add_subdirectory(FPUtil) -add_subdirectory(OSUtil) diff --git a/libc/src/__support/threads/linux/CMakeLists.txt b/libc/src/__support/threads/linux/CMakeLists.txt index 558cf14..8b29802 100644 --- a/libc/src/__support/threads/linux/CMakeLists.txt +++ b/libc/src/__support/threads/linux/CMakeLists.txt @@ -4,6 +4,10 @@ add_header_library( futex_word.h ) +if(NOT TARGET libc.src.__support.OSUtil.osutil) + return() +endif() + add_header_library( mutex HDRS -- 2.7.4