aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-graphics/vulkan/vulkan-loader-layers/0001-CMakeLists-add-include-path-so-Xlib.h-is-found-as-ne.patch
blob: 10337189f6c1795d61ddbb1953b46cd2af777f06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From 49d4dd326b9d4b7b013f4a1d21498568d76443b2 Mon Sep 17 00:00:00 2001
From: Awais Belal <awais_belal@mentor.com>
Date: Tue, 4 Sep 2018 14:09:12 +0500
Subject: [PATCH 1/5] CMakeLists: add include path so Xlib.h is found as needed

All the targets including vk_platform.h or directly including
X11/Xlib.h require to know the directory for the installed
header. Add the directory to these so the requirements are
filled in properly.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 CMakeLists.txt             | 2 ++
 demos/CMakeLists.txt       | 1 +
 layers/CMakeLists.txt      | 1 +
 libs/vkjson/CMakeLists.txt | 1 +
 loader/CMakeLists.txt      | 1 +
 5 files changed, 6 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cf85d487..5ce69d216 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -225,6 +225,8 @@ find_path(SPIRV_TOOLS_INCLUDE_DIR spirv-tools/libspirv.h HINTS "${EXTERNAL_SOURC
                                                    "${CMAKE_SOURCE_DIR}/../glslang/External/spirv-tools/include"
                                              DOC "Path to spirv-tools/libspirv.h")
 
+find_path(X11_XLIB_INCLUDE_DIR X11/Xlib.h DOC "Path to X11/Xlib.h")
+
 find_library(GLSLANG_LIB NAMES glslang
              HINTS ${GLSLANG_SEARCH_PATH} )
 
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
index 487b19910..fb5022bf5 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
@@ -41,6 +41,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
         set(DEMO_INCLUDE_DIRS
             ${X11_INCLUDE_DIR}
             ${DEMO_INCLUDE_DIRS}
+            ${X11_XLIB_INCLUDE_DIR}
         )
         link_libraries(${X11_LIBRARIES})
         add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index 08b0e2090..6068d0031 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -146,6 +146,7 @@ include_directories(
     ${CMAKE_CURRENT_BINARY_DIR}
     ${PROJECT_BINARY_DIR}
     ${CMAKE_BINARY_DIR}
+    ${X11_XLIB_INCLUDE_DIR}
 )
 
 if (WIN32)
diff --git a/libs/vkjson/CMakeLists.txt b/libs/vkjson/CMakeLists.txt
index 2e79d9109..4b1df5988 100644
--- a/libs/vkjson/CMakeLists.txt
+++ b/libs/vkjson/CMakeLists.txt
@@ -23,6 +23,7 @@ include_directories(
 	${CMAKE_CURRENT_SOURCE_DIR}
 	${CMAKE_CURRENT_SOURCE_DIR}/../../loader
 	${CMAKE_CURRENT_SOURCE_DIR}/../../include/vulkan
+	${X11_XLIB_INCLUDE_DIR}
 	)
 
 add_library(vkjson STATIC vkjson.cc vkjson_instance.cc ../../loader/cJSON.c)
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 4d1d08fc8..55ae2cb85 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -3,6 +3,7 @@ include_directories(
     ${CMAKE_CURRENT_BINARY_DIR}
     ${PROJECT_BINARY_DIR}
     ${CMAKE_BINARY_DIR}
+    ${X11_XLIB_INCLUDE_DIR}
 )
 
 # Check for the existance of the secure_getenv or __secure_getenv commands
-- 
2.11.1