From 8c3ab15f371acac8f2aa794a8a68f3a314da6233 Mon Sep 17 00:00:00 2001 From: Vikram Date: Thu, 11 Jan 2024 11:48:51 -0500 Subject: [PATCH] SWDEV-420140 - Prefer forward slashes for path seperators in compiler RT path with windows Certain build systems such as NMake seem to interpret backslashes as escapes. Change-Id: Ifc04d9427148e83084efb1af94a1ce85cb2a6c4e [ROCm/clr commit: cec5f0b70414356351d4605626a8c0261e484cf0] --- projects/clr/hipamd/hip-config-amd.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/clr/hipamd/hip-config-amd.cmake b/projects/clr/hipamd/hip-config-amd.cmake index b27029be8c..00f05dc9c9 100755 --- a/projects/clr/hipamd/hip-config-amd.cmake +++ b/projects/clr/hipamd/hip-config-amd.cmake @@ -178,6 +178,12 @@ if( CLANGRT_Error ) else() # Add support for __fp16 and _Float16, explicitly link with compiler-rt if( "${CLANGRT_BUILTINS_FETCH_EXIT_CODE}" STREQUAL "0" ) + # The HIP_CXX_COMPILER by default prefers backward slashes for path seperators on windows. + # Prefer forward slashes here to avoid escaping issues on certain build systems. + if(WIN32) + string(REPLACE "\\" "/" CLANGRT_BUILTINS ${CLANGRT_BUILTINS}) + endif() + # CLANG_RT Builtins found Successfully Set interface link libraries property set_property(TARGET hip::host APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${CLANGRT_BUILTINS}") set_property(TARGET hip::device APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${CLANGRT_BUILTINS}")