[llvm] c398923 - [CMake][runtimes] Check LLVM_ENABLE_PROJECTS for libc (#76845)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 12:14:37 PST 2024


Author: Petr Hosek
Date: 2024-01-04T12:14:32-08:00
New Revision: c398923f32ff5373964e1288d9de37403c2399dd

URL: https://github.com/llvm/llvm-project/commit/c398923f32ff5373964e1288d9de37403c2399dd
DIFF: https://github.com/llvm/llvm-project/commit/c398923f32ff5373964e1288d9de37403c2399dd.diff

LOG: [CMake][runtimes] Check LLVM_ENABLE_PROJECTS for libc (#76845)

Only some targets may be building llvm-libc in which case the top-level
LLVM_ENABLE_RUNTIMES variable won't contain libc. Rather, we can check
LLVM_ENABLE_PROJECTS since libc is required to be included there for
libc-hdrgen to be built (and when LLVM_ENABLE_RUNTIMES contains libc, we
automatically include libc in LLVM_ENABLE_PROJECTS as well).

Added: 
    

Modified: 
    llvm/runtimes/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index db50b6d1e8f8c3..b9acb862cc5cb2 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -423,7 +423,7 @@ if(runtimes)
       endif()
     endforeach()
   endif()
-  if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND 
+  if("libc" IN_LIST LLVM_ENABLE_PROJECTS AND
       (LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES))
     if(TARGET libc-hdrgen)
       set(libc_tools libc-hdrgen)


        


More information about the llvm-commits mailing list