From 11eeb6cbf28e1bfbe94b9b684c19808af949dad5 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 12 May 2020 14:40:58 -0400 Subject: [PATCH] Use option for USE_COMGR_LIBRARY Use standard cmake option handling, and switch to standard ON/OFF for boolean. Try to maintain compatability with the "yes" check that build scripts are now using. Change-Id: Ia932e93f818c0897a87bfc49b070e36c7be7dd74 [ROCm/clr commit: aa0c163066e8c56e065287410a487830800a72a1] --- projects/clr/opencl/CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/projects/clr/opencl/CMakeLists.txt b/projects/clr/opencl/CMakeLists.txt index 8ba4730cff..4c7da46bb3 100644 --- a/projects/clr/opencl/CMakeLists.txt +++ b/projects/clr/opencl/CMakeLists.txt @@ -8,16 +8,27 @@ endif() project(opencl) #example command: -#cmake -DROCclr_DIR=/rocclr -DUSE_COMGR_LIBRARY=yes -DLIBROCclr_STATIC_DIR=/build .. +#cmake -DROCclr_DIR=/rocclr -DUSE_COMGR_LIBRARY=ON -DLIBROCclr_STATIC_DIR=/build .. set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/khronos/headers/opencl2.2" CACHE PATH "") set(BUILD_SHARED_LIBS "Build shared libs" ON) +# FIXME: Handling legacy custom boolean matching "yes" or "no" +if(DEFINED USE_COMGR_LIBRARY) + if(${USE_COMGR_LIBRARY} MATCHES "yes") + set(USE_COMGR_LIBRARY ON) + elseif(${USE_COMGR_LIBRARY} MATCHES "no") + set(USE_COMGR_LIBRARY OFF) + endif() +endif() + +option(USE_COMGR_LIBRARY "Use comgr library" ON) + set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -if(${USE_COMGR_LIBRARY} MATCHES "yes") +if(USE_COMGR_LIBRARY) add_definitions(-DUSE_COMGR_LIBRARY -DCOMGR_DYN_DLL) find_package(amd_comgr REQUIRED CONFIG PATHS