[libc][NFC] Add src.__support.OSUtil targets conditionally.

Before this change, they were unconditionally added, irrespective of the
availability of the architecture specific pieces.
This commit is contained in:
Siva Chandra Reddy 2022-06-15 06:32:06 +00:00
parent 3ecfeb4c2f
commit a099139fa9
2 changed files with 16 additions and 6 deletions

View File

@ -1,4 +1,12 @@
add_subdirectory(linux)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
return()
endif()
add_subdirectory(${LIBC_TARGET_OS})
set(target_os_util libc.src.__support.OSUtil.${LIBC_TARGET_OS}.${LIBC_TARGET_OS}_util)
if(NOT TARGET ${target_os_util})
return()
endif()
add_header_library(
osutil
@ -7,5 +15,5 @@ add_header_library(
quick_exit.h
syscall.h
DEPENDS
libc.src.__support.OSUtil.linux.linux_util
${target_os_util}
)

View File

@ -1,5 +1,8 @@
add_subdirectory(aarch64)
add_subdirectory(x86_64)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_ARCHITECTURE})
return()
endif()
add_subdirectory(${LIBC_TARGET_ARCHITECTURE})
add_header_library(
linux_util
@ -8,7 +11,6 @@ add_header_library(
quick_exit.h
syscall.h
DEPENDS
.aarch64.linux_aarch64_util
.x86_64.linux_x86_64_util
.${LIBC_TARGET_ARCHITECTURE}.linux_${LIBC_TARGET_ARCHITECTURE}_util
libc.src.__support.common
)