From c0585ad814c972f58abe279b98828d6c25b772d1 Mon Sep 17 00:00:00 2001
From: Ahmed Ismail <64546783+AhmedIsmail02@users.noreply.github.com>
Date: Fri, 25 Oct 2024 23:33:33 +0100
Subject: [PATCH] freertos-config: Fix library definitions scope (#1164)

Since `freertos_config` is an interface library,
`INTERFACE` scope shall be used to define compile
definitions.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
---
 portable/CMakeLists.txt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/portable/CMakeLists.txt b/portable/CMakeLists.txt
index 4c39c76bf..f761ebc47 100644
--- a/portable/CMakeLists.txt
+++ b/portable/CMakeLists.txt
@@ -804,7 +804,7 @@ if (DEFINED FREERTOS_ARM_V_8_1_M_PACBTI_CONFIG )
                         -mbranch-protection=bti+pac-ret+leaf
                 )
                 target_compile_definitions(freertos_config
-                    PUBLIC
+                    INTERFACE
                         configENABLE_PAC=1
                         configENABLE_BTI=1
                 )
@@ -815,7 +815,7 @@ if (DEFINED FREERTOS_ARM_V_8_1_M_PACBTI_CONFIG )
             target_compile_options(freertos_kernel_port PUBLIC $<$<STREQUAL:${CMAKE_C_COMPILER_ID},ARMClang>:-mbranch-protection=pac-ret>)
             target_compile_options(freertos_kernel_port PUBLIC $<$<STREQUAL:${CMAKE_C_COMPILER_ID},IAR>:$<$<COMPILE_LANGUAGE:C,CXX>:--branch_protection=pac-ret>>)
             target_compile_definitions(freertos_config
-                PUBLIC
+                INTERFACE
                     configENABLE_PAC=1
             )
         elseif(FREERTOS_ARM_V_8_1_M_PACBTI_CONFIG STREQUAL "ARM_V_8_1_M_PACBTI_CONFIG_PACRET_LEAF")
@@ -825,7 +825,7 @@ if (DEFINED FREERTOS_ARM_V_8_1_M_PACBTI_CONFIG )
                         -mbranch-protection=pac-ret+leaf
                 )
                 target_compile_definitions(freertos_config
-                    PUBLIC
+                    INTERFACE
                         configENABLE_PAC=1
                 )
             elseif(${CMAKE_C_COMPILER_ID} STREQUAL "IAR")
@@ -835,7 +835,7 @@ if (DEFINED FREERTOS_ARM_V_8_1_M_PACBTI_CONFIG )
             target_compile_options(freertos_kernel_port PUBLIC $<$<STREQUAL:${CMAKE_C_COMPILER_ID},ARMClang>:-mbranch-protection=bti>)
             target_compile_options(freertos_kernel_port PUBLIC $<$<STREQUAL:${CMAKE_C_COMPILER_ID},IAR>:$<$<COMPILE_LANGUAGE:C,CXX>:--branch_protection=bti>>)
             target_compile_definitions(freertos_config
-                PUBLIC
+                INTERFACE
                     configENABLE_BTI=1
             )
         elseif(FREERTOS_ARM_V_8_1_M_PACBTI_CONFIG STREQUAL "ARM_V_8_1_M_PACBTI_CONFIG_NONE")
@@ -846,7 +846,7 @@ if (DEFINED FREERTOS_ARM_V_8_1_M_PACBTI_CONFIG )
                 )
             endif()
             target_compile_definitions(freertos_config
-                PUBLIC
+                INTERFACE
                     configENABLE_PAC=0
                     configENABLE_BTI=0
             )