Files
TheRock/base/rocm-cmake/share/rocmcmakebuildtools/cmake/ROCMChecks.cmake
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

67 lines
3.1 KiB
CMake

# ######################################################################################################################
# Copyright (C) 2019-2021 Advanced Micro Devices, Inc.
# ######################################################################################################################
set(ROCM_WARN_TOOLCHAIN_VAR
ON
CACHE BOOL "")
set(ROCM_ERROR_TOOLCHAIN_VAR
OFF
CACHE BOOL "")
# environment variable control of options. Note prefix is ROCMCHECKS
if(DEFINED ENV{ROCMCHECKS_WARN_TOOLCHAIN_VAR})
set(ROCM_WARN_TOOLCHAIN_VAR $ENV{ROCMCHECKS_WARN_TOOLCHAIN_VAR})
endif()
if(DEFINED ENV{ROCMCHECKS_ERROR_TOOLCHAIN_VAR})
set(ROCM_ERROR_TOOLCHAIN_VAR $ENV{ROCMCHECKS_ERROR_TOOLCHAIN_VAR})
endif()
function(rocm_check_toolchain_var var access value list_file)
set(message_type STATUS)
if(ROCM_ERROR_TOOLCHAIN_VAR)
set(message_type SEND_ERROR)
set(message_title " ROCMChecks ERROR ")
elseif(ROCM_WARN_TOOLCHAIN_VAR)
set(message_type WARNING)
set(message_title "ROCMChecks WARNING")
endif()
if(access STREQUAL "MODIFIED_ACCESS")
set(cmake_module Off)
get_filename_component(base "${list_file}" DIRECTORY)
# Skip warning in cmake's built-in modules
if("${base}" STREQUAL "${CMAKE_ROOT}/Modules")
set(cmake_module On)
elseif("${base}" MATCHES ".*/CMakeFiles/${CMAKE_VERSION}$")
set(cmake_module On)
endif()
if(NOT cmake_module)
message( "
*******************************************************************************
*------------------------------- ${message_title} --------------------------*
Options and properties should be set on a cmake target where possible. The
variable '${var}' may be set by the cmake toolchain, either by
calling 'cmake -D${var}=\"${value}\"'
or set in a toolchain file and added with
'cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file>'. ROCMChecks now calling:")
message(${message_type} "'${var}' is set at ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt:<line#> shown below:")
message( "*-----------------------------------------------------------------------------*
*******************************************************************************
")
endif()
endif()
endfunction()
if(UNIX AND (ROCM_WARN_TOOLCHAIN_VAR OR ROCM_ERROR_TOOLCHAIN_VAR))
foreach(LANG C CXX Fortran)
variable_watch(CMAKE_${LANG}_COMPILER rocm_check_toolchain_var)
variable_watch(CMAKE_${LANG}_FLAGS rocm_check_toolchain_var)
variable_watch(CMAKE_${LANG}_LINK_EXECUTABLE rocm_check_toolchain_var)
variable_watch(CMAKE_${LANG}_SIZEOF_DATA_PTR rocm_check_toolchain_var)
variable_watch(CMAKE_${LANG}_STANDARD_INCLUDE_DIRECTORIES rocm_check_toolchain_var)
variable_watch(CMAKE_${LANG}_STANDARD_LIBRARIES rocm_check_toolchain_var)
endforeach()
variable_watch(CMAKE_EXE_LINKER_FLAGS rocm_check_toolchain_var)
variable_watch(CMAKE_MODULE_LINKER_FLAGS rocm_check_toolchain_var)
variable_watch(CMAKE_SHARED_LINKER_FLAGS rocm_check_toolchain_var)
variable_watch(CMAKE_STATIC_LINKER_FLAGS rocm_check_toolchain_var)
endif()