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
This commit is contained in:
Ioannis Assiouras
2025-01-30 18:24:45 +00:00
rodzic 2e2b6b3592
commit 8f54aeb765
+1 -1
Wyświetl plik
@@ -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)