From e45ee8c37a2f8a7dc1d50d0453c8a5066330ee02 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Thu, 13 Apr 2017 14:41:11 +0530 Subject: [PATCH] FindHIP: Handle remove_item from empty lists Change-Id: I6adf31b32edeae9e8454b1a2528064cf3985fca1 --- hipamd/cmake/FindHIP.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hipamd/cmake/FindHIP.cmake b/hipamd/cmake/FindHIP.cmake index 0001436fee..1d71238ce6 100644 --- a/hipamd/cmake/FindHIP.cmake +++ b/hipamd/cmake/FindHIP.cmake @@ -514,7 +514,7 @@ macro(HIP_ADD_EXECUTABLE hip_target) # Separate the sources from the options HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN}) HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options}) - list(REMOVE_ITEM _sources ${_source_files}) + list(REMOVE_ITEM _sources "${_source_files}") if("x${HCC_HOME}" STREQUAL "x") set(HCC_HOME "/opt/rocm/hcc") endif() @@ -530,7 +530,7 @@ macro(HIP_ADD_LIBRARY hip_target) # Separate the sources from the options HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN}) HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} ${_cmake_options} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options}) - list(REMOVE_ITEM _sources ${_source_files}) + list(REMOVE_ITEM _sources "${_source_files}") add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources}) set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX}) endmacro()