From ef4c6ebd654c23bc174bfb75cc064144ee115949 Mon Sep 17 00:00:00 2001 From: Akshit K <104486478+code-steadfast@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:48:05 +0100 Subject: [PATCH] feat: provide list of productive sources (#112) Co-authored-by: Kobagapu, Akshit (RDS-RM) --- cmake/common.cmake | 6 ++++++ cmake/spl.cmake | 2 +- docs/reference/index.rst | 1 + docs/reference/variables.rst | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 docs/reference/variables.rst diff --git a/cmake/common.cmake b/cmake/common.cmake index 2337df2..2104316 100644 --- a/cmake/common.cmake +++ b/cmake/common.cmake @@ -107,6 +107,12 @@ macro(spl_create_component) target_compile_options(${component_name} PRIVATE ${VARIANT_ADDITIONAL_COMPILE_C_FLAGS}) endif() + # Collect all productive sources for later usage (e.g., in an extension) + list(APPEND PROD_SOURCES ${SOURCES}) + set(PROD_SOURCES ${PROD_SOURCES} PARENT_SCOPE) + message(DEBUG "Productive sources: ${PROD_SOURCES}") + + # Collect all component names for later usage (e.g., in an extension) list(APPEND COMPONENT_NAMES ${component_name}) set(COMPONENT_NAMES ${COMPONENT_NAMES} PARENT_SCOPE) diff --git a/cmake/spl.cmake b/cmake/spl.cmake index 2ddb765..e21d5d2 100644 --- a/cmake/spl.cmake +++ b/cmake/spl.cmake @@ -94,4 +94,4 @@ add_custom_command( COMMAND set "KCONFIG_CONFIG=${CMAKE_SOURCE_DIR}/variants/${VARIANT}/config.txt" && cd ${CMAKE_SOURCE_DIR} && guiconfig ) -add_custom_target(configuration DEPENDS ${_CONFIGURATION_TARGET}) \ No newline at end of file +add_custom_target(configuration DEPENDS ${_CONFIGURATION_TARGET}) diff --git a/docs/reference/index.rst b/docs/reference/index.rst index d18ab87..f916b14 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -5,3 +5,4 @@ :maxdepth: 2 macros + variables diff --git a/docs/reference/variables.rst b/docs/reference/variables.rst new file mode 100644 index 0000000..968fcc0 --- /dev/null +++ b/docs/reference/variables.rst @@ -0,0 +1,18 @@ +CMake Variables +=============== + + +COMPONENT_NAMES +--------------- + +The list of components of the current variant. + +PROD_SOURCES +------------ + +List of all productive source files of all components of the current variant. + +target_include_directories__INCLUDES +------------------------------------ + +List of all include directories of all components of the current variant.