In this case, the solution direction commented by @Tsyvarev was chosen.
Instead of including the runner.c file a dependent library was linked.
Each platform directory creates its own version of the platform runner library.
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:
Dependencies are more clear, that they are on a specific library rather than a file.
Library dependencies can be made clear rather than single file dependencies.