From b5025c19248169b50dee0d8eba5e5eb7ed4d5c0f Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 5 Aug 2019 11:41:06 -0400
Subject: [PATCH] P4 to Git Change 1978446 by kzhuravl@kzhuravl-spot-ocl on
2019/08/05 11:37:30
SWDEV-79445 - OCL generic changes and code clean-up
Bring cmake changes from gerrit (reviewed and tested on gerrit)
Affected files ...
... //depot/stg/opencl/drivers/opencl/CMakeLists.txt#28 edit
... //depot/stg/opencl/drivers/opencl/tools/clinfo/CMakeLists.txt#7 edit
---
opencl/CMakeLists.txt | 26 ++++++++------------------
opencl/tools/clinfo/CMakeLists.txt | 2 +-
2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/opencl/CMakeLists.txt b/opencl/CMakeLists.txt
index 3e3868fa22..83575a39dd 100644
--- a/opencl/CMakeLists.txt
+++ b/opencl/CMakeLists.txt
@@ -28,14 +28,11 @@ endif()
project(OpenCL-ROCm)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2" CACHE PATH "")
-# Add path for custom modules
-set(CMAKE_MODULE_PATH
- ${CMAKE_MODULE_PATH}
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
- )
+find_package(ROCT REQUIRED)
+find_package(ROCR REQUIRED)
# FIXME: Remove following if block after enabling COMGR by default
if (${USE_COMGR_LIBRARY} STREQUAL "no")
@@ -96,21 +93,14 @@ if(${USE_COMGR_LIBRARY} MATCHES "yes")
endif()
endif()
-add_subdirectory(compiler/lib/loaders/elf/utils/libelf)
-
-find_package(ROCT REQUIRED)
-find_package(ROCR REQUIRED)
-add_subdirectory(runtime)
-
-set(OPENCL_INCLUDE_DIRS
- ${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers
- ${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2)
-
add_subdirectory(api/opencl/amdocl)
-add_subdirectory(api/opencl/khronos/icd)
-
+add_subdirectory(compiler/lib/loaders/elf/utils/libelf)
+add_subdirectory(runtime)
add_subdirectory(tools/clinfo)
+set(BUILD_SHARED_LIBS "Build shared libs" ON)
+add_subdirectory(api/opencl/khronos/icd)
+
###--- Packaging ------------------------------------------------------------###
# MAIN package
diff --git a/opencl/tools/clinfo/CMakeLists.txt b/opencl/tools/clinfo/CMakeLists.txt
index 08765e1a0d..f4b30b2e02 100644
--- a/opencl/tools/clinfo/CMakeLists.txt
+++ b/opencl/tools/clinfo/CMakeLists.txt
@@ -2,7 +2,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-include_directories(${OPENCL_INCLUDE_DIRS})
+include_directories(${OPENCL_ICD_LOADER_HEADERS_DIR})
add_definitions(-DHAVE_CL2_HPP)