From 417851d666feec4d65d47503d479ec16f82d3db5 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Thu, 30 Sep 2021 20:05:25 +0000 Subject: [PATCH] SWDEV-289558 - Generate hip-config.cmake on Windows Change-Id: I00b553bcba596e882573b99cfb6894c310cf7c2a [ROCm/clr commit: bcfac99cea580d176eb56dd2ec21f51ade2644bd] --- projects/clr/hipamd/CMakeLists.txt | 5 ++--- projects/clr/hipamd/hip-config.cmake.in | 17 ++++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/projects/clr/hipamd/CMakeLists.txt b/projects/clr/hipamd/CMakeLists.txt index 1f0bc15014..3fbd759864 100755 --- a/projects/clr/hipamd/CMakeLists.txt +++ b/projects/clr/hipamd/CMakeLists.txt @@ -386,8 +386,6 @@ install(FILES ${PROJECT_BINARY_DIR}/include/hip/hip_version.h ############################# # hip-config ############################# -# Packaging invokes UNIX commands, which are not available on Windows. -if(NOT WIN32) include(CMakePackageConfigHelpers) configure_package_config_file( @@ -409,7 +407,8 @@ install( DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR} ) - +# Packaging invokes UNIX commands, which are not available on Windows. +if(NOT WIN32) ############################# # Packaging steps ############################# diff --git a/projects/clr/hipamd/hip-config.cmake.in b/projects/clr/hipamd/hip-config.cmake.in index 6116d0877a..274e3f1be4 100755 --- a/projects/clr/hipamd/hip-config.cmake.in +++ b/projects/clr/hipamd/hip-config.cmake.in @@ -94,16 +94,19 @@ set_and_check( hip_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" ) set_and_check( hip_INCLUDE_DIRS "${hip_INCLUDE_DIR}" ) set_and_check( hip_LIB_INSTALL_DIR "@PACKAGE_LIB_INSTALL_DIR@" ) set_and_check( hip_BIN_INSTALL_DIR "@PACKAGE_BIN_INSTALL_DIR@" ) - -set_and_check(hip_HIPCC_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipcc") -set_and_check(hip_HIPCONFIG_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipconfig") - +if(WIN32) + set_and_check(hip_HIPCC_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipcc.bat") + set_and_check(hip_HIPCONFIG_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipconfig.bat") +else() + set_and_check(hip_HIPCC_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipcc") + set_and_check(hip_HIPCONFIG_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipconfig") +endif() # Windows Specific Definition here: if(WIN32) if(DEFINED ENV{HIP_PATH}) - set(HIP_PATH "$ENV{HIP_PATH}") + file(TO_CMAKE_PATH "$ENV{HIP_PATH}" HIP_PATH) elseif(DEFINED ENV{HIP_DIR}) - set(HIP_PATH "$ENV{HIP_DIR}") + file(TO_CMAKE_PATH "$ENV{HIP_DIR}" HIP_DIR) else() set(HIP_PATH "C:/Program Files/AMD HIP SDK/hip") endif() @@ -121,7 +124,7 @@ endif() if(HIP_COMPILER STREQUAL "clang") if(WIN32) - set(HIP_CLANG_ROOT "${HIP_PATH}") + file(TO_CMAKE_PATH "$ENV{HIP_PATH}" HIP_CLANG_ROOT) else() set(HIP_CLANG_ROOT "${ROCM_PATH}/llvm") endif()