From 8b4b14943de92a2c7f8b328c2de75771493b7d18 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Mon, 10 Jul 2023 14:09:16 +0100
Subject: [PATCH] OPTEE Private Includes

Change the optee module includes to be private instead of public, so they don't get used
in every build, which can result in compile failures as /core/include/ doesn't exit.

For some reason this behaviour isn't deterministic, a ticket has been filed with upstream.

Upstream-Status: Submitted [https://gitlab.arm.com/firmware/SCP-firmware/-/merge_requests/1198]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 product/optee/common/module/console/CMakeLists.txt | 2 +-
 product/optee/common/module/mbx/CMakeLists.txt     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/optee/common/module/console/CMakeLists.txt b/product/optee/common/module/console/CMakeLists.txt
index aebb7cc79766..942aa98c85ff 100644
--- a/product/optee/common/module/console/CMakeLists.txt
+++ b/product/optee/common/module/console/CMakeLists.txt
@@ -14,7 +14,7 @@ target_include_directories(${SCP_MODULE_TARGET}
 # Those includes are needed for mutex definitnion that is used in optee_smt
 # notification
 target_include_directories(${SCP_MODULE_TARGET}
-                           PUBLIC "${SCP_OPTEE_DIR}/core/arch/arm/include/"
+                           PRIVATE "${SCP_OPTEE_DIR}/core/arch/arm/include/"
                                   "${SCP_OPTEE_DIR}/core/include/"
                                   "${SCP_OPTEE_DIR}/lib/libutils/ext/include/"
                                   "${SCP_OPTEE_DIR}/lib/libutee/include/")
diff --git a/product/optee/common/module/mbx/CMakeLists.txt b/product/optee/common/module/mbx/CMakeLists.txt
index 305fa42b7370..783a7970c2d5 100644
--- a/product/optee/common/module/mbx/CMakeLists.txt
+++ b/product/optee/common/module/mbx/CMakeLists.txt
@@ -15,7 +15,7 @@ target_include_directories(${SCP_MODULE_TARGET}
 # Those includes are needed for mutex defifitnion that is used in optee_smt
 # notification
 target_include_directories(${SCP_MODULE_TARGET}
-                           PUBLIC "${SCP_OPTEE_DIR}/core/include/"
+                           PRIVATE "${SCP_OPTEE_DIR}/core/include/"
                                   "${SCP_OPTEE_DIR}/lib/libutils/ext/include/"
                                   "${SCP_OPTEE_DIR}/lib/libutee/include/")
 
