Support empty sources in add_executable and add_library

Change-Id: I1441f2c045aeda2bba99bffe1c99fcc4a59cea9b


[ROCm/clr commit: e3617167f5]
This commit is contained in:
Rahul Garg
2020-06-09 15:52:59 +00:00
orang tua d66c70a8e1
melakukan ce2da5238a
+10 -2
Melihat File
@@ -638,7 +638,11 @@ macro(HIP_ADD_EXECUTABLE hip_target)
endif()
set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()
add_executable(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
if ("${_sources}" STREQUAL "")
add_executable(${hip_target} ${_cmake_options} ${_generated_files} "")
else()
add_executable(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
endif()
set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE HIP)
endmacro()
@@ -652,7 +656,11 @@ macro(HIP_ADD_LIBRARY hip_target)
if(_source_files)
list(REMOVE_ITEM _sources ${_source_files})
endif()
add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
if ("${_sources}" STREQUAL "")
add_library(${hip_target} ${_cmake_options} ${_generated_files} "")
else()
add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
endif()
set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX})
endmacro()