From 4a35f560f6ffd1be26ca2c50a1c63c79d1aaa646 Mon Sep 17 00:00:00 2001 From: Cordell Bloor Date: Mon, 9 Nov 2020 14:21:01 -0700 Subject: [PATCH] Fix CMake configure error due to CMP0012 The modern meaning of the construct if( NOT ON ) was added in CMake 2.8, but when the cmake_minimum_required not set in user code and no policy level is set in the CMake config, then CMake 2.8 features cannot be used. In old CMake (the default), ON is interpreted as a variable, and because it is not defined, it is considered false. The same is true of OFF. This change sets a variable as ON, so that old CMake interpretation is correct, and the if works as expected regardless of policy version. Change-Id: I67d7ed4ceaf8248eeb5a1c7f54009d72313f3f5d --- runtime/hsa-runtime/hsa-runtime64-config.cmake.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/hsa-runtime64-config.cmake.in b/runtime/hsa-runtime/hsa-runtime64-config.cmake.in index 629216ce55..3b57b0995f 100644 --- a/runtime/hsa-runtime/hsa-runtime64-config.cmake.in +++ b/runtime/hsa-runtime/hsa-runtime64-config.cmake.in @@ -45,7 +45,8 @@ include( CMakeFindDependencyMacro ) # Client apps only need our private dependencies if rocr is a static lib. -if( NOT @BUILD_SHARED_LIBS@ ) +set( _is_hsa_runtime_dynamic @BUILD_SHARED_LIBS@ ) +if( NOT _is_hsa_runtime_dynamic ) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}")