From 2c3ce272e6f478d62df17fa81a59e46254f19f2e Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 16 Sep 2016 10:16:34 +0530 Subject: [PATCH] FindHIP: determine HIP_PLATFORM at build time instead of compile time Change-Id: Icb99d23f2874c4c15771641d7e3e91bb5c918f27 --- hipamd/cmake/FindHIP.cmake | 2 +- hipamd/cmake/FindHIP/run_hipcc.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hipamd/cmake/FindHIP.cmake b/hipamd/cmake/FindHIP.cmake index 2541cf6ec6..1666673beb 100644 --- a/hipamd/cmake/FindHIP.cmake +++ b/hipamd/cmake/FindHIP.cmake @@ -416,7 +416,7 @@ macro(HIP_PREPARE_TARGET_COMMANDS _target _format _generated_files) # Create up the comment string file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") - set(hip_build_comment_string "Building HIPCC (using ${HIP_PLATFORM}) object ${generated_file_relative_path}") + set(hip_build_comment_string "Building HIPCC object ${generated_file_relative_path}") # Build the generated file and dependency file add_custom_command( diff --git a/hipamd/cmake/FindHIP/run_hipcc.cmake b/hipamd/cmake/FindHIP/run_hipcc.cmake index 52ad57f532..6027cb9b0d 100644 --- a/hipamd/cmake/FindHIP/run_hipcc.cmake +++ b/hipamd/cmake/FindHIP/run_hipcc.cmake @@ -22,8 +22,8 @@ endif() # Set these up as variables to make reading the generated file easier set(HIP_HIPCC_EXECUTABLE "@HIP_HIPCC_EXECUTABLE@") # path +set(HIP_HIPCONFIG_EXECUTABLE "@HIP_HIPCONFIG_EXECUTABLE@") #path set(HIP_HOST_COMPILER "@HIP_HOST_COMPILER@") # path -set(HIP_PLATFORM "@HIP_PLATFORM@") #string set(CMAKE_COMMAND "@CMAKE_COMMAND@") # path set(HIP_run_make2cmake "@HIP_run_make2cmake@") # path @@ -38,6 +38,7 @@ set(source_file "@source_file@") # path set(host_flag "@host_flag@") # bool # Determine compiler and compiler flags +execute_process(COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --platform OUTPUT_VARIABLE HIP_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT host_flag) set(__CC ${HIP_HIPCC_EXECUTABLE}) if(HIP_PLATFORM STREQUAL "hcc")