From a6d568b9ca1f2546aaa9cd989a588e645fc3a813 Mon Sep 17 00:00:00 2001 From: Aaron En Ye Shi Date: Wed, 16 Jun 2021 20:57:39 +0000 Subject: [PATCH] SWDEV-291481 - Port hipcc.bat and hipconfig.bat Add the hipcc.bat and hipconfig.bat files previously only residing in P4 to CMake builds. Ship this .bat file as part of bin directory on Windows. Change-Id: I2822e1419f1f6a0a6cdde9e292231995a83df77d --- CMakeLists.txt | 8 +++++++- bin/hipcc.bat | 2 ++ bin/hipconfig.bat | 2 ++ packaging/hip-base.txt | 7 ++++++- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 bin/hipcc.bat create mode 100644 bin/hipconfig.bat diff --git a/CMakeLists.txt b/CMakeLists.txt index b573a9a79a..4cd932fbb6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,13 @@ install(FILES ${PROJECT_BINARY_DIR}/.hipVersion DESTINATION bin) execute_process(COMMAND test ${CMAKE_INSTALL_PREFIX} -ef ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE INSTALL_SOURCE) if(NOT ${INSTALL_SOURCE} EQUAL 0) - install(DIRECTORY bin DESTINATION . USE_SOURCE_PERMISSIONS) + # Exclude .bat files on Linux. + if(WIN32) + install(DIRECTORY bin DESTINATION . USE_SOURCE_PERMISSIONS) + else() + install(DIRECTORY bin DESTINATION . USE_SOURCE_PERMISSIONS + PATTERN *.bat EXCLUDE) + endif() # The following two lines will be removed after upstream updation install(CODE "MESSAGE(\"Removing ${CMAKE_INSTALL_PREFIX}/include\")") diff --git a/bin/hipcc.bat b/bin/hipcc.bat new file mode 100644 index 0000000000..104e78622d --- /dev/null +++ b/bin/hipcc.bat @@ -0,0 +1,2 @@ +@IF DEFINED HIP_PATH (set HIPCC="%HIP_PATH%/bin/hipcc") ELSE (set HIPCC="%CD%/hipcc") +@perl %HIPCC% %* diff --git a/bin/hipconfig.bat b/bin/hipconfig.bat new file mode 100644 index 0000000000..64db66aece --- /dev/null +++ b/bin/hipconfig.bat @@ -0,0 +1,2 @@ +@IF DEFINED HIP_PATH (set HIPCONFIG="%HIP_PATH%/bin/hipconfig") ELSE (set HIPCONFIG="%CD%/hipconfig") +@perl %HIPCONFIG% %* diff --git a/packaging/hip-base.txt b/packaging/hip-base.txt index efd4357229..b3fd6aaf6e 100644 --- a/packaging/hip-base.txt +++ b/packaging/hip-base.txt @@ -21,7 +21,12 @@ cmake_minimum_required(VERSION 2.8.3) project(hip_base) -install(DIRECTORY @hip_SOURCE_DIR@/bin DESTINATION . USE_SOURCE_PERMISSIONS) +if(WIN32) + install(DIRECTORY @hip_SOURCE_DIR@/bin DESTINATION . USE_SOURCE_PERMISSIONS) +else() + install(DIRECTORY @hip_SOURCE_DIR@/bin DESTINATION . USE_SOURCE_PERMISSIONS + PATTERN *.bat EXCLUDE) +endif() install(DIRECTORY @hip_SOURCE_DIR@/include DESTINATION .) install(DIRECTORY @HIP_AMD_BACKEND_SOURCE_DIR@/include/hip/amd_detail DESTINATION include/hip) install(DIRECTORY @HIP_AMD_BACKEND_SOURCE_DIR@/include/hip/nvidia_detail DESTINATION include/hip)