[libc-commits] [libc] [libc][NFC] Eliminate the internal header library target. (PR #65837)

Siva Chandra via libc-commits libc-commits at lists.llvm.org
Fri Sep 8 22:51:26 PDT 2023


https://github.com/sivachandra created https://github.com/llvm/llvm-project/pull/65837:

The internal header library target with name suffix `.__header_library`
has been removed as it serves no purpose now. It was added to make older
versions of CMake happy.


>From 4161e08738cc92302df22a5a37551c9ec7ce2d53 Mon Sep 17 00:00:00 2001
From: Siva Chandra Reddy <sivachandra at google.com>
Date: Sat, 9 Sep 2023 05:38:21 +0000
Subject: [PATCH] [libc][NFC] Eliminate the internal header library target.

The internal header library target with name suffix `.__header_library`
has been removed as it serves no purpose now. It was added to make older
versions of CMake happy.
---
 libc/cmake/modules/LLVMLibCLibraryRules.cmake | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index 8ffe2d3b739926c..40a4cf647762e1d 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -175,27 +175,19 @@ function(create_header_library fq_target_name)
       endforeach()
     endif()
   endif()
-  set(interface_target_name "${fq_target_name}.__header_library__")
 
-  add_library(${interface_target_name} INTERFACE)
-  target_sources(${interface_target_name} INTERFACE ${FULL_HDR_PATHS})
+  add_library(${fq_target_name} INTERFACE)
+  target_sources(${fq_target_name} INTERFACE ${FULL_HDR_PATHS})
   if(ADD_HEADER_DEPENDS)
-    add_dependencies(${interface_target_name} ${ADD_HEADER_DEPENDS})
+    add_dependencies(${fq_target_name} ${ADD_HEADER_DEPENDS})
   endif()
-  set_target_properties(
-    ${interface_target_name}
-    PROPERTIES
-      INTERFACE_FLAGS "${ADD_HEADER_FLAGS}"
-  )
   if(ADD_HEADER_COMPILE_OPTIONS)
-    target_compile_options(${interface_target_name} INTERFACE ${ADD_HEADER_COMPILE_OPTIONS})
+    target_compile_options(${fq_target_name} INTERFACE ${ADD_HEADER_COMPILE_OPTIONS})
   endif()
-
-  add_custom_target(${fq_target_name})
-  add_dependencies(${fq_target_name} ${interface_target_name})
   set_target_properties(
     ${fq_target_name}
     PROPERTIES
+      INTERFACE_FLAGS "${ADD_HEADER_FLAGS}"
       TARGET_TYPE "${HDR_LIBRARY_TARGET_TYPE}"
       DEPS "${ADD_HEADER_DEPENDS}"
       FLAGS "${ADD_HEADER_FLAGS}"



More information about the libc-commits mailing list