Make directed_test support static libs

1.Make directed_test apps linked against static libs
    of hip, rocclr, rocr, roct and amd_comgr.
    2.Remove custom_target amdhip64_static_combiner.
    3.Support EXCLUDE_HIP_LIB_TYPE <static|shared>.
    4.Simplify argument list parsing.
    5.Install rocclr when rocm is installed.
    6.Fix some original small bugs.

Revert "Revert "Make directed_test support static libs""
This reverts commit 5b7533e49f.

Change-Id: I918eeae94487e5e2ff5bfde083667ac65fb6e702
This commit is contained in:
Tao Sang
2020-10-12 10:27:33 -04:00
parent 2bf7282bd5
commit bcd067f462
20 changed files with 322 additions and 271 deletions
+181 -219
View File
@@ -3,10 +3,14 @@ find_package(HIP REQUIRED)
set(HIP_CTEST_CONFIG_DEFAULT "default")
set(HIP_CTEST_CONFIG_PERFORMANCE "performance")
set(HIP_LIB_TYPE "shared")
if (NOT ${BUILD_SHARED_LIBS})
set(HIP_LIB_TYPE "static")
endif()
message(STATUS "HIP_LIB_TYPE - ${HIP_LIB_TYPE}")
#-------------------------------------------------------------------------------
# Helper macro to parse BUILD instructions
macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _depends _dir)
macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends _dir)
set(${_target})
set(${_sources})
set(${_hipcc_options})
@@ -17,239 +21,181 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _clang_op
set(${_exclude_platforms})
set(${_exclude_runtime})
set(${_exclude_compiler})
set(${_exclude_lib_type})
set(${_depends})
set(_target_found FALSE)
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
set(_flag "")
foreach(arg ${ARGN})
if(NOT _target_found)
set(_target_found TRUE)
set(${_target} ${arg})
elseif("x${arg}" STREQUAL "xHIPCC_OPTIONS")
set(_hipcc_options_found TRUE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xHCC_OPTIONS")
set(_hipcc_options_found FALSE)
set(_hcc_options_found TRUE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xCLANG_OPTIONS")
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found TRUE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xNVCC_OPTIONS")
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found TRUE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xLINK_OPTIONS")
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found TRUE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found TRUE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found TRUE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found TRUE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xDEPENDS")
set(_hipcc_options_found FALSE)
set(_hcc_options_found FALSE)
set(_clang_options_found FALSE)
set(_nvcc_options_found FALSE)
set(_link_options_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found TRUE)
elseif("x${arg}" STREQUAL "xHIPCC_OPTIONS"
OR "x${arg}" STREQUAL "xHCC_OPTIONS"
OR "x${arg}" STREQUAL "xCLANG_OPTIONS"
OR "x${arg}" STREQUAL "xNVCC_OPTIONS"
OR "x${arg}" STREQUAL "xLINK_OPTIONS"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE"
OR "x${arg}" STREQUAL "xDEPENDS")
set(_flag ${arg})
elseif("x${_flag}" STREQUAL "xHIPCC_OPTIONS")
list(APPEND ${_hipcc_options} ${arg})
elseif("x${_flag}" STREQUAL "xHCC_OPTIONS")
list(APPEND ${_hcc_options} ${arg})
elseif("x${_flag}" STREQUAL "xCLANG_OPTIONS")
list(APPEND ${_clang_options} ${arg})
elseif("x${_flag}" STREQUAL "xNVCC_OPTIONS")
list(APPEND ${_nvcc_options} ${arg})
elseif("x${_flag}" STREQUAL "xLINK_OPTIONS")
list(APPEND ${_link_options} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
list(APPEND ${_exclude_platforms} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
list(APPEND ${_exclude_runtime} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER")
list(APPEND ${_exclude_compiler} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE")
list(APPEND ${_exclude_lib_type} ${arg})
elseif("x${_flag}" STREQUAL "xDEPENDS")
list(APPEND ${_depends} ${arg})
else()
if(_hipcc_options_found)
list(APPEND ${_hipcc_options} ${arg})
elseif(_hcc_options_found)
list(APPEND ${_hcc_options} ${arg})
elseif(_clang_options_found)
list(APPEND ${_clang_options} ${arg})
elseif(_nvcc_options_found)
list(APPEND ${_nvcc_options} ${arg})
elseif(_link_options_found)
list(APPEND ${_link_options} ${arg})
elseif(_exclude_platforms_found)
list(APPEND ${_exclude_platforms} ${arg})
elseif(_exclude_runtime_found)
list(APPEND ${_exclude_runtime} ${arg})
elseif(_exclude_compiler_found)
list(APPEND ${_exclude_compiler} ${arg})
elseif(_depends_found)
list(APPEND ${_depends} ${arg})
else()
list(APPEND ${_sources} "${_dir}/${arg}")
endif()
list(APPEND ${_sources} "${_dir}/${arg}")
endif()
endforeach()
endmacro()
# Helper macro to parse CUSTOM BUILD instructions
macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _depends)
macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends)
set(${_target})
set(${_buildcmd} " ")
set(${_buildcmd})
set(${_exclude_platforms})
set(${_exclude_runtime})
set(${_exclude_compiler})
set(${_exclude_lib_type})
set(${_depends})
set(_target_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
set(_flag "")
foreach(arg ${ARGN})
if(NOT _target_found)
set(_target_found TRUE)
set(${_target} ${arg})
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
set(_exclude_platforms_found TRUE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found TRUE)
set(_exclude_compiler_found FALSE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found TRUE)
set(_depends_found FALSE)
elseif("x${arg}" STREQUAL "xDEPENDS")
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_depends_found TRUE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE"
OR "x${arg}" STREQUAL "xDEPENDS")
set(_flag ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
list(APPEND ${_exclude_platforms} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
list(APPEND ${_exclude_runtime} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER")
list(APPEND ${_exclude_compiler} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE")
list(APPEND ${_exclude_lib_type} ${arg})
elseif("x${_flag}" STREQUAL "xDEPENDS")
list(APPEND ${_depends} ${arg})
else()
if(_exclude_platforms_found)
list(APPEND ${_exclude_platforms} ${arg})
elseif(_exclude_runtime_found)
list(APPEND ${_exclude_runtime} ${arg})
elseif(_exclude_compiler_found)
list(APPEND ${_exclude_compiler} ${arg})
elseif(_depends_found)
list(APPEND ${_depends} ${arg})
else()
list(APPEND ${_buildcmd} ${arg})
endif()
list(APPEND ${_buildcmd} ${arg}) # always before exclude lists
endif()
endforeach()
endmacro()
# Helper macro to parse command part of CUSTOM BUILD instructions
macro(PARSE_CUSTOMBUILD_COMMAND_PART _compiler _target _target_type _sources _options)
set(${_compiler})
set(${_target})
set(${_target_type} "EXECUTABLE")
set(${_sources})
set(${_options})
set(_compiler_found FALSE)
set(_target_found FALSE)
foreach(arg ${ARGN})
if(NOT _compiler_found)
set(_compiler_found TRUE)
set(${_compiler} ${arg})
elseif("x${arg}" STREQUAL "x-o")
set(_target_found TRUE)
elseif(_target_found)
set(${_target} ${arg})
set(_target_found FALSE)
elseif("x${arg}" STREQUAL "x-c" OR "x${arg}" STREQUAL "x--genco")
set(${_target_type} "OBJECT")
list(APPEND ${_options} ${arg})
elseif("x${arg}" STREQUAL "x-shared")
# Note: Currently all directed_tests are linux based.
set(${_target_type} "SHARED")
list(APPEND ${_options} ${arg})
elseif("x${arg}" MATCHES "^x-I")
# -I
list(APPEND ${_options} ${arg})
elseif("x${arg}" MATCHES "^x.*\.cpp$")
# cpp file
list(APPEND ${_sources} ${arg})
elseif("x${arg}" MATCHES "^x.*\.c$")
# c file
list(APPEND ${_sources} ${arg})
else()
list(APPEND ${_options} ${arg})
endif()
endforeach()
endmacro()
# Helper macro to parse TEST instructions
macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms _exclude_runtime _exclude_compiler)
macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type)
set(${_target})
set(${_arguments} " ")
set(${_exclude_platforms})
set(${_exclude_runtime})
set(${_exclude_compiler})
set(${_exclude_lib_type})
set(_target_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_flag "")
foreach(arg ${ARGN})
if(NOT _target_found)
set(_target_found TRUE)
set(${_target} ${arg})
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
set(_exclude_platforms_found TRUE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found TRUE)
set(_exclude_compiler_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found TRUE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE")
set(_flag ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
list(APPEND ${_exclude_platforms} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
list(APPEND ${_exclude_runtime} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER")
list(APPEND ${_exclude_compiler} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE")
list(APPEND ${_exclude_lib_type} ${arg})
else()
if(_exclude_platforms_found)
list(APPEND ${_exclude_platforms} ${arg})
elseif(_exclude_runtime_found)
list(APPEND ${_exclude_runtime} ${arg})
elseif(_exclude_compiler_found)
list(APPEND ${_exclude_compiler} ${arg})
else()
list(APPEND ${_arguments} ${arg})
endif()
list(APPEND ${_arguments} ${arg}) # always before exclude lists
endif()
endforeach()
endmacro()
# Helper macro to parse TEST_NAMED instructions
macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler)
macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type)
set(${_target})
set(${_arguments} " ")
set(${_exclude_platforms})
set(${_exclude_runtime})
set(${_exclude_compiler})
set(${_exclude_lib_type})
set(_target_found FALSE)
set(_testname_found FALSE)
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
set(_flag "")
foreach(arg ${ARGN})
if(NOT _target_found)
set(_target_found TRUE)
@@ -257,28 +203,21 @@ macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms _
elseif(NOT _testname_found)
set(_testname_found TRUE)
set(${_testname} ${arg})
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
set(_exclude_platforms_found TRUE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found TRUE)
set(_exclude_compiler_found FALSE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
set(_exclude_platforms_found FALSE)
set(_exclude_runtime_found FALSE)
set(_exclude_compiler_found TRUE)
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER"
OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE")
set(_flag ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
list(APPEND ${_exclude_platforms} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
list(APPEND ${_exclude_runtime} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER")
list(APPEND ${_exclude_compiler} ${arg})
elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE")
list(APPEND ${_exclude_lib_type} ${arg})
else()
if(_exclude_platforms_found)
list(APPEND ${_exclude_platforms} ${arg})
elseif(_exclude_runtime_found)
list(APPEND ${_exclude_runtime} ${arg})
elseif(_exclude_compiler_found)
list(APPEND ${_exclude_compiler} ${arg})
else()
list(APPEND ${_arguments} ${arg})
endif()
list(APPEND ${_arguments} ${arg}) # always before exclude lists
endif()
endforeach()
endmacro()
@@ -329,7 +268,7 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
foreach(_cmd ${_contents})
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
parse_build_command(_target _sources _hipcc_options _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _depends ${_dir} ${_cmd})
parse_build_command(_target _sources _hipcc_options _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends ${_dir} ${_cmd})
string(REGEX REPLACE "/" "." target ${_label}/${_target})
if("all" IN_LIST _exclude_platforms OR ${HIP_PLATFORM} IN_LIST _exclude_platforms)
insert_into_map("_exclude" "${target}" TRUE)
@@ -337,7 +276,9 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
insert_into_map("_exclude" "${target}" TRUE)
elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime)
insert_into_map("_exclude" "${target}" TRUE)
elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
insert_into_map("_exclude" "${target}" TRUE)
elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type)
insert_into_map("_exclude" "${target}" TRUE)
else()
set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
@@ -368,7 +309,7 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
string(REGEX REPLACE "%T" ${_label} _contents "${_contents}")
foreach(_cmd ${_contents})
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
parse_custombuild_command(_target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _depends ${_cmd})
parse_custombuild_command(_target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends ${_cmd})
string(REGEX REPLACE "/" "." target ${_label}/${_target})
if("all" IN_LIST _exclude_platforms OR ${HIP_PLATFORM} IN_LIST _exclude_platforms)
insert_into_map("_exclude" "${target}" TRUE)
@@ -376,14 +317,33 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
insert_into_map("_exclude" "${target}" TRUE)
elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime)
insert_into_map("_exclude" "${target}" TRUE)
elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
insert_into_map("_exclude" "${target}" TRUE)
elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type)
insert_into_map("_exclude" "${target}" TRUE)
else()
parse_custombuild_command_part(_compiler _target_r _target_type _sources _options ${_buildcmd})
string(REGEX REPLACE ";" " " _buildcmd "${_buildcmd}")
#string(CONCAT buildscript ${CMAKE_CURRENT_BINARY_DIR}/${target} ".sh")
#file(WRITE ${buildscript} ${_buildcmd})
#add_custom_target(${target} COMMAND ${buildscript})
add_custom_target(${target} COMMAND sh -c "${_buildcmd}")
string(REGEX REPLACE ";" " " _options "${_options}")
set(CHOICE_FLAG "${HIP_LIB_TYPE}" STREQUAL "static" AND "${_compiler}" MATCHES "hipcc$"
AND "${HIP_RUNTIME}" STREQUAL "rocclr" AND "${HIP_COMPILER}" STREQUAL "clang")
if (${CHOICE_FLAG} AND "${_target_type}" STREQUAL "EXECUTABLE")
# message(STATUS "hip_add_executable*:_target_r= ${_target_r} --- target= ${target} --- _sources=${_sources} --- _options=${_options}")
set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
hip_reset_flags()
hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_options} EXCLUDE_FROM_ALL)
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target_r} RUNTIME_OUTPUT_DIRECTORY "." LINK_DEPENDS "${HIP_LIB_FILES}")
elseif(${CHOICE_FLAG} AND "${_target_type}" STREQUAL "SHARED")
# message(STATUS "hip_add_library*:_target_r= ${_target_r} --- target= ${target} --- _sources=${_sources} --- _options=${_options}")
set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
hip_reset_flags()
hip_add_library(${target} ${_sources} HIPCC_OPTIONS ${_options} EXCLUDE_FROM_ALL ${_target_type})
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target_r} RUNTIME_OUTPUT_DIRECTORY "." LINK_DEPENDS "${HIP_LIB_FILES}" PREFIX "" SUFFIX "")
else()
# message(STATUS "add_custom_target*: target= ${target} _buildcmd= ${_buildcmd}")
add_custom_target(${target} COMMAND sh -c "${_buildcmd}")
endif()
add_dependencies(${_parent} ${target})
foreach(_dependency ${_depends})
string(REGEX REPLACE "/" "." _dependency ${_label}/${_dependency})
@@ -401,13 +361,14 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
foreach(_cmd ${_contents})
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
parse_test_command(_target _arguments _exclude_platforms _exclude_runtime _exclude_compiler ${_cmd})
parse_test_command(_target _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type ${_cmd})
string(REGEX REPLACE "/" "." target ${_label}/${_target})
read_from_map("_exclude" "${target}" _exclude_test_from_build)
if("all" IN_LIST _exclude_platforms OR ${HIP_PLATFORM} IN_LIST _exclude_platforms)
elseif(NOT _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime)
elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type)
elseif(_exclude_test_from_build STREQUAL TRUE)
else()
make_test(${_config} ${_label}/${_target} ${_arguments})
@@ -423,13 +384,14 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
foreach(_cmd ${_contents})
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
parse_test_named_command(_target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler ${_cmd})
parse_test_named_command(_target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type ${_cmd})
string(REGEX REPLACE "/" "." target ${_label}/${_target})
read_from_map("_exclude" "${target}" _exclude_test_from_build)
if("all" IN_LIST _exclude_platforms OR ${HIP_PLATFORM} IN_LIST _exclude_platforms)
elseif(NOT _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime)
elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler)
elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type)
elseif(_exclude_test_from_build STREQUAL TRUE)
else()
make_named_test(${_config} ${_label}/${_target} ${_label}/${_testname}.tst ${_arguments})