summaryrefslogtreecommitdiff
path: root/py/py.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'py/py.cmake')
-rw-r--r--py/py.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/py/py.cmake b/py/py.cmake
index 52baaa8ef..be5deca25 100644
--- a/py/py.cmake
+++ b/py/py.cmake
@@ -122,3 +122,25 @@ set(MICROPY_SOURCE_PY
${MICROPY_PY_DIR}/vstr.c
${MICROPY_PY_DIR}/warning.c
)
+
+# Helper macro to collect include directories and compile definitions for qstr processing.
+macro(micropy_gather_target_properties targ)
+ if(TARGET ${targ})
+ get_target_property(type ${targ} TYPE)
+ set(_inc OFF)
+ set(_def OFF)
+ if(${type} STREQUAL STATIC_LIBRARY)
+ get_target_property(_inc ${targ} INCLUDE_DIRECTORIES)
+ get_target_property(_def ${targ} COMPILE_DEFINITIONS)
+ elseif(${type} STREQUAL INTERFACE_LIBRARY)
+ get_target_property(_inc ${targ} INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(_def ${targ} INTERFACE_COMPILE_DEFINITIONS)
+ endif()
+ if(_inc)
+ list(APPEND MICROPY_CPP_INC_EXTRA ${_inc})
+ endif()
+ if(_def)
+ list(APPEND MICROPY_CPP_DEF_EXTRA ${_def})
+ endif()
+ endif()
+endmacro()