diff --git a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt index 62c92326e3..1a8d2cb6d9 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt @@ -42,6 +42,23 @@ cmake_minimum_required ( VERSION 3.5.0 ) +## Cosmetic Cmake version warnings. +if(NOT EXISTS VERSION_WARNED) + set (VERSION_WARNED FALSE CACHE BOOL "") +endif() +if(${CMAKE_VERSION} VERSION_LESS "3.6.0" AND NOT ${VERSION_WARNED}) + message("Your CMake version is too old for full functionality. +Generated package file names may be incorrect. +Please update to CMake 3.6 or newer to generate correct package file names") + set( VERSION_WARNED TRUE CACHE BOOL "Suppress cosmetic build errors due to CMake version after first warning." FORCE ) + mark_as_advanced( FORCE VERSION_WARNED ) +endif() + +## Clear target dependency data. +## Needed to allow UI transitions between static and dynamic builds. +## Need an update to CMake 3.12 to remove this hack. See CMake policy change CMP0073. +unset ( hsa-runtime64_LIB_DEPENDS CACHE ) + ## Set core runtime module name and project name. set ( CORE_RUNTIME_NAME "hsa-runtime64" ) set ( CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}" ) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/image/blit_src/CMakeLists.txt b/projects/rocr-runtime/runtime/hsa-runtime/image/blit_src/CMakeLists.txt index 12dae5846e..f80b2fd035 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/image/blit_src/CMakeLists.txt +++ b/projects/rocr-runtime/runtime/hsa-runtime/image/blit_src/CMakeLists.txt @@ -46,12 +46,13 @@ cmake_minimum_required ( VERSION 3.5.0 ) set (QUIT 0) # Import target 'clang' -find_package(Clang REQUIRED HINTS ${CMAKE_INSTALL_PREFIX}/llvm PATHS /opt/rocm/llvm ) +find_package(Clang REQUIRED HINTS ${CMAKE_INSTALL_PREFIX}/llvm ${CMAKE_PREFIX_PATH}/llvm PATHS /opt/rocm/llvm ) # Device libs doesn't support find_package yet. get_include_path(BITCODE_DIR "Bitcode library path" RESULT FOUND NAMES "opencl.amdgcn.bc" HINTS "${CMAKE_INSTALL_PREFIX}/lib/bitcode" "${CMAKE_INSTALL_PREFIX}/lib/x86_64/bitcode" - PATHS "/opt/rocm/lib/bitcode" "${CMAKE_INSTALL_PREFIX}/lib/x86_64/bitcode") + "${CMAKE_PREFIX_PATH}/lib/bitcode" "${CMAKE_PREFIX_PATH}/lib/x86_64/bitcode" + PATHS "/opt/rocm/lib/bitcode" "/opt/rocm/lib/x86_64/bitcode") if (NOT ${FOUND}) set (QUIT 1) endif()