[llvm-branch-commits] [compiler-rt] 4f44cd0 - Use set_output_name rather than hardcoding the output name

Petr Hosek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 1 22:49:40 PST 2026


Author: Petr Hosek
Date: 2026-01-02T06:46:25Z
New Revision: 4f44cd088bbcd04aaeb4c404ed932cdff290a691

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

LOG: Use set_output_name rather than hardcoding the output name

The output name can change depending on variables such as
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR and set_output_name is used
throughout compiler-rt to correctly construct the output name.

Added: 
    

Modified: 
    compiler-rt/lib/builtins/CMakeLists.txt
    compiler-rt/test/builtins/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 19483d2547997..7948c291b065d 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -1025,9 +1025,11 @@ else ()
                               C_STANDARD 11
                               CXX_STANDARD 17
                               PARENT_TARGET builtins)
+
       # Write out the sources that were used to compile the builtins so that tests can be run in
       # an independent compiler-rt build (see: compiler-rt/test/builtins/CMakeLists.txt)
-      file(WRITE "${CMAKE_BINARY_DIR}/clang_rt.builtins-${arch}.sources.txt" "${${arch}_SOURCES}")
+      set_output_name(BUILTIN_LIB_TARGET_NAME clang_rt.builtins ${arch})
+      file(WRITE "${CMAKE_BINARY_DIR}/${BUILTIN_LIB_TARGET_NAME}.sources.txt" "${${arch}_SOURCES}")
       cmake_pop_check_state()
     endif ()
   endforeach ()

diff  --git a/compiler-rt/test/builtins/CMakeLists.txt b/compiler-rt/test/builtins/CMakeLists.txt
index 64545a711b0bc..06d590c15fd9a 100644
--- a/compiler-rt/test/builtins/CMakeLists.txt
+++ b/compiler-rt/test/builtins/CMakeLists.txt
@@ -92,7 +92,7 @@ foreach(arch ${BUILTIN_TEST_ARCH})
     # TODO: Support other Apple platforms.
     set(BUILTIN_LIB_TARGET_NAME "clang_rt.builtins_${arch}_osx")
   else()
-    set(BUILTIN_LIB_TARGET_NAME "clang_rt.builtins-${arch}")
+    set_output_name(BUILTIN_LIB_TARGET_NAME clang_rt.builtins ${arch})
   endif()
   # Normally, we can just inspect the target directly to get the sources, but if
   # we are testing an externally-built builtins library, we expect


        


More information about the llvm-branch-commits mailing list