From ce65bb86374b7f3ec1826dab43d535d5e366ce20 Mon Sep 17 00:00:00 2001
From: Emilio Corigliano <emilio.corigliano@skywarder.eu>
Date: Fri, 10 May 2024 18:09:22 +0200
Subject: [PATCH] [cmake] Added custom property to store compilation flags

---
 miosix/cmake/miosix.cmake | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/miosix/cmake/miosix.cmake b/miosix/cmake/miosix.cmake
index a381fc82..ce1add57 100644
--- a/miosix/cmake/miosix.cmake
+++ b/miosix/cmake/miosix.cmake
@@ -74,6 +74,12 @@ define_property(TARGET
     BRIEF_DOCS "Preperty that stores the link libraries of the target"
 )
 
+# Creating property to store the link directories
+define_property(TARGET 
+    PROPERTY TARGET_CXX_FLAGS INHERITED 
+    BRIEF_DOCS "Preperty that stores the CXX flags of the target"
+)
+
 # Function to configure a target to be built for the kernel
 function(configure_target_for_kernel TARGET TYPE)
     # Include kernel directories
@@ -148,6 +154,7 @@ function(add_miosix_libraries BOARD_OPTIONS_FILE)
     set(INTERFACE_LIB interface-${BOARD_NAME})
     add_library(${INTERFACE_LIB} INTERFACE)
     configure_target_for_kernel(${INTERFACE_LIB} INTERFACE)
+    set_property(TARGET ${INTERFACE_LIB} PROPERTY TARGET_CXX_FLAGS ${CXXFLAGS_BASE})
 
     # Configure linker file and options
     set_property(TARGET ${KERNEL_LIB} PROPERTY INTERFACE_LINK_DEPENDS ${LINKER_SCRIPT})
-- 
GitLab