[libclc] [libclc] Fix installation w/ ENABLE_RUNTIME_SUBNORMAL (PR #109926)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 25 01:22:22 PDT 2024


https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/109926

The ARCHIVE artifact kind is not valid for install(FILES ...).

Additionally, install wasn't resolving the target's TARGET_FILE properly and was trying to find it in the top-level build directory, rather than in the libclc binary directory. All other install() invocations in libclc explicitly use CMAKE_CURRENT_BINARY_DIR, so use this for consistency. There might be another more modern way of doing this.

>From 55b7c432c8abafcf721cf1bab8f099253dedf1a0 Mon Sep 17 00:00:00 2001
From: Fraser Cormack <fraser at codeplay.com>
Date: Wed, 25 Sep 2024 09:18:10 +0100
Subject: [PATCH] [libclc] Fix installation w/ ENABLE_RUNTIME_SUBNORMAL

The ARCHIVE artifact kind is not valid for install(FILES ...).

Additionally, install wasn't resolving the target's TARGET_FILE properly
and was trying to find it in the top-level build directory, rather than
in the libclc binary directory. All other install() invocations in
libclc explicitly use CMAKE_CURRENT_BINARY_DIR, so use this for
consistency. There might be another more modern way of doing this.
---
 libclc/CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 1bf7eb2ca7ed7e..df29e702733e94 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -221,8 +221,10 @@ if( ENABLE_RUNTIME_SUBNORMAL )
        TARGET ${file}
        INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/${file}.ll
     )
-    install( FILES $<TARGET_PROPERTY:${file},TARGET_FILE> ARCHIVE
-      DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
+    install(
+      FILES ${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_PROPERTY:${file},TARGET_FILE>
+      DESTINATION "${CMAKE_INSTALL_DATADIR}/clc"
+    )
   endforeach()
 endif()
 



More information about the cfe-commits mailing list