79596068

Date: 2025-04-28 08:42:00
Score: 1
Natty:
Report link

In this case, the solution direction commented by @Tsyvarev was chosen.

The following alterations have been made to the solution above.

# app-cpu1/CMakeLists.txt
add_executable(CPU1-app
  src/.. src files .ext
)
target_link_libraries(CPU1-app
    runnerLibrary
)
# target/platform/CMakeLists.txt

add_library(runnerLibrary STATIC
    src/runner.c
)
target_include_directories(runnerLibrary PRIVATE
    additional/include/directories)
target_link_libraries(runnerLibrary PRIVATE
    additional/link/libraries)

This solution made more sense that the initial proposed solution in the question:

  1. Dependencies are more clear, that they are on a specific library rather than a file.

  2. Library dependencies can be made clear rather than single file dependencies.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Tsyvarev
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Jan Jaap