From 8f54aeb7654e28d2744a631eaf2af9a29f68ea8e Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Thu, 30 Jan 2025 18:24:45 +0000 Subject: [PATCH] SWDEV-511813 - Fix linkage of hipRTC-header.o into libhiprtc.a Using target_link_libraries does not properly link the hipRTC-header.o into libhiprtc for static build. Change to use target_sources instead. This does not affect the linkage in the shared build. Change-Id: I626f9eacc1637b792a50e7ddddb5db09e704ac4a --- hipamd/src/hiprtc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hipamd/src/hiprtc/CMakeLists.txt b/hipamd/src/hiprtc/CMakeLists.txt index 18f266b658..ef473f6237 100644 --- a/hipamd/src/hiprtc/CMakeLists.txt +++ b/hipamd/src/hiprtc/CMakeLists.txt @@ -238,7 +238,7 @@ add_custom_command( COMMAND ${clang} -O3 --rocm-path=${PROJECT_SOURCE_DIR}/include/.. -std=c++14 -nogpulib -nogpuinc -emit-llvm -c -isystem ${HIP_COMMON_INCLUDE_DIR} -isystem ${PROJECT_BINARY_DIR}/include -isystem ${CMAKE_CURRENT_SOURCE_DIR}/include --cuda-device-only -D__HIPCC_RTC__ --offload-arch=gfx906 -x hip-cpp-output ${HIPRTC_GEN_PREPROCESSED} -o ${HIPRTC_GEN_DIR}/tmp.bc DEPENDS ${clang} ${HIPRTC_GEN_PREPROCESSED}) -target_link_libraries(hiprtc PRIVATE ${HIPRTC_GEN_OBJ}) +target_sources(hiprtc PRIVATE ${HIPRTC_GEN_OBJ}) target_compile_definitions(hiprtc PRIVATE __HIP_ENABLE_RTC) if(NOT WIN32)