Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
matrix:
platform:
- ubuntu-20.04
- macos-12
- windows-2019
cmake-version:
- 3.20.0
- 3.10.2
- 3.31.0
- 3.22.1
- 3.16.3
exclude:
- platform: windows-2019
cmake-version: 3.10.2
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2017 Advanced Micro Devices, Inc.
################################################################################

cmake_minimum_required (VERSION 3.6)
cmake_minimum_required (VERSION 3.6...3.31.0)

set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "")

Expand Down
23 changes: 20 additions & 3 deletions share/rocmcmakebuildtools/cmake/ROCMCheckTargetIds.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,26 @@ function(_rocm_sanitize_target_id TARGET_ID VARIABLE)
# CMake defines a preprocessor macro with this value, so it must be a valid C identifier
# Handle + and - for xnack and sramecc so that e.g. xnack+ and xnack- doesn't get folded to
# the same string by MAKE_C_IDENTIFIER
string(REPLACE "_" "__" TARGET_ID "${TARGET_ID}")
string(REPLACE "+" "_on" TARGET_ID "${TARGET_ID}")
string(REPLACE "-" "_off" TARGET_ID "${TARGET_ID}")

# Target ID syntax:
# <target-id> ::== <processor> ( ":" <target-feature> ( "+" | "-" ) )*

# split target id by colon into a list of components
string(REPLACE ":" ";" _components "${TARGET_ID}")
list(GET _components 0 _processor)
list(REMOVE_AT _components 0)
# remove '-' from processor name
string(REPLACE "-" "_" _processor "${_processor}")
if(_components)
# remove '+' or '-' from target features
string(REPLACE "+" "_on" _components "${_components}")
string(REPLACE "-" "_off" _components "${_components}")
# join components with a colon
string(REPLACE ";" ":" TARGET_ID "${_processor}:${_components}")
else()
set(TARGET_ID "${_processor}")
endif()

string(MAKE_C_IDENTIFIER "${TARGET_ID}" TARGET_ID)
set(${VARIABLE} "${TARGET_ID}" PARENT_SCOPE)
endfunction()
5 changes: 5 additions & 0 deletions share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ macro(rocm_package_add_rocm_core_dependency)
endif()
rocm_join_if_set(", " CPACK_DEBIAN_PACKAGE_DEPENDS ${_rocm_core_pkg})
rocm_join_if_set(", " CPACK_RPM_PACKAGE_REQUIRES ${_rocm_core_pkg})
foreach(COMPONENT IN LISTS ROCM_PACKAGE_COMPONENTS)
rocm_package_add_dependencies(COMPONENT ${COMPONENT} DEPENDS ${_rocm_core_pkg})
endforeach()
rocm_package_add_dependencies(COMPONENT runtime DEPENDS ${_rocm_core_pkg})
rocm_package_add_dependencies(COMPONENT devel DEPENDS ${_rocm_core_pkg})
unset(_rocm_core_pkg)
endif()
endmacro()
Expand Down
2 changes: 1 addition & 1 deletion share/rocmcmakebuildtools/cmake/ROCMTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ macro(rocm_enable_test_package NAME)
endmacro()

if(POLICY CMP0079)
cmake_policy(SET CMP0079 OLD)
cmake_policy(SET CMP0079 NEW)
endif()

add_library(rocm_test_dependencies INTERFACE)
Expand Down
2 changes: 1 addition & 1 deletion test/analyze/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(simple LANGUAGES CXX)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/docsphinx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2023 Advanced Micro Devices, Inc.
################################################################################

cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(useful LANGUAGES CXX)
# Ideally should be NONE, but GNUInstallDirs detects platform arch using try_compile
# https://stackoverflow.com/questions/43379311/why-does-project-affect-cmakes-opinion-on-cmake-sizeof-void-p
Expand Down
2 changes: 1 addition & 1 deletion test/findpackagecheck/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(findpackagecheck CXX)

message(STATUS "PKG: ${PKG}")
Expand Down
2 changes: 1 addition & 1 deletion test/libbasic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(basic CXX)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/libheaderonly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(headeronly LANGUAGES NONE)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/libprivate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(libprivate CXX)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/libsimple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(simple CXX)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/libsimple2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(simple2 CXX)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/libsimplecompat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(simple CXX)

find_package(ROCM)
Expand Down
2 changes: 1 addition & 1 deletion test/libsimpletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(simple CXX)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/libwrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(test-wrapper CXX)

find_package(ROCmCMakeBuildTools)
Expand Down
2 changes: 1 addition & 1 deletion test/pass/rocm-package-setup-component.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10...3.31.0)

use_rocm_cmake()
include(ROCMCreatePackage)
Expand Down
2 changes: 1 addition & 1 deletion test/toolchain-var/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################


cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
find_package(ROCmCMakeBuildTools)
project(toolchain-var CXX)

Expand Down
2 changes: 1 addition & 1 deletion test/version/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2017 Advanced Micro Devices, Inc.
################################################################################

cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.5...3.31.0)
project(simple LANGUAGES NONE)

find_package(ROCmCMakeBuildTools)
Expand Down
Loading