Add cmake variable BUILD_ROCR so that user can elect to not
build ROCr.

Change-Id: I73bd28cde9430ba86aed50fb88ec2e42b3443dbb


[ROCm/ROCR-Runtime commit: a676d8639c]
Этот коммит содержится в:
Chris Freehill
2024-09-04 09:45:02 -05:00
коммит произвёл Chris Freehill
родитель 8d1fe1f7ea
Коммит f0baa90369
+14 -9
Просмотреть файл
@@ -46,10 +46,12 @@ cmake_minimum_required(VERSION 3.7)
# Set the project name
project("rocr")
# option(BUILD_TESTS "Build tests" OFF)
set(CMAKE_VERBOSE_MAKEFILE ON)
if (NOT DEFINED BUILD_ROCR)
set(BUILD_ROCR ON)
endif()
function(add_rocm_subdir subdir subdir_assigns)
message("add_rocm_subdir() -- " ${subdir})
# message(" subdir_assigns before:" ${subdir_assigns} "EOM")
@@ -93,16 +95,20 @@ set_target_properties(hsakmt PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/libhsakmt/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/libhsakmt/runtime")
add_rocm_subdir(runtime/hsa-runtime "${ROCR_DEFINITIONS}")
set_target_properties(hsa-runtime64 PROPERTIES
if (BUILD_ROCR)
add_rocm_subdir(runtime/hsa-runtime "${ROCR_DEFINITIONS}")
set_target_properties(hsa-runtime64 PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/rocr/archive"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/rocr/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/rocr/runtime")
if (BUILD_SHARED_LIBS)
add_dependencies(hsa-runtime64 hsakmt)
else()
add_dependencies(hsa-runtime64 hsakmt-staticdrm)
if (BUILD_SHARED_LIBS)
add_dependencies(hsa-runtime64 hsakmt)
else()
add_dependencies(hsa-runtime64 hsakmt-staticdrm)
endif()
endif()
# Optionally record the package's find module in the user's package cache.
if ( NOT DEFINED EXPORT_TO_USER_PACKAGE_REGISTRY )
set ( EXPORT_TO_USER_PACKAGE_REGISTRY "off")
@@ -117,7 +123,6 @@ if(${EXPORT_TO_USER_PACKAGE_REGISTRY})
export(PACKAGE ${CORE_RUNTIME_NAME})
endif()
## Packaging directives
set(CPACK_VERBOSE 1)
set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Package types to build")