Skip to content

Commit

Permalink
feat: provide list of productive sources (#112)
Browse files Browse the repository at this point in the history
Co-authored-by: Kobagapu, Akshit (RDS-RM) <[email protected]>
  • Loading branch information
code-steadfast and Akshit-MQ authored Jan 2, 2024
1 parent 13431d5 commit ef4c6eb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion cmake/spl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
add_custom_target(configuration DEPENDS ${_CONFIGURATION_TARGET})
1 change: 1 addition & 0 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
:maxdepth: 2

macros
variables
18 changes: 18 additions & 0 deletions docs/reference/variables.rst
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit ef4c6eb

Please sign in to comment.