From c3c8e40b6cb123be3bdd1ec878d0d265618b6814 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 22 Apr 2026 13:16:50 -0500 Subject: [PATCH] [Runtimes] Allow HandleLibc.cmake to be called multiple times (#193540) Summary: This needs to check to see if it's already been called now that we want to use it more places than just libcxx. --- runtimes/cmake/Modules/HandleLibC.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtimes/cmake/Modules/HandleLibC.cmake b/runtimes/cmake/Modules/HandleLibC.cmake index aa076441345d..9b6749dd2615 100644 --- a/runtimes/cmake/Modules/HandleLibC.cmake +++ b/runtimes/cmake/Modules/HandleLibC.cmake @@ -10,6 +10,10 @@ include_guard(GLOBAL) +if(TARGET runtimes-libc-headers) + return() +endif() + set(RUNTIMES_SUPPORTED_C_LIBRARIES system llvm-libc picolibc newlib) set(RUNTIMES_USE_LIBC "system" CACHE STRING "Specify C library to use. Supported values are ${RUNTIMES_SUPPORTED_C_LIBRARIES}.") if (NOT "${RUNTIMES_USE_LIBC}" IN_LIST RUNTIMES_SUPPORTED_C_LIBRARIES)