CMakeLists.txt: limit libraries linked to by ${PROJECT_NAME}

Old behaviour was linking to all components, but main.c currently only
needs a few of them.
This commit is contained in:
Xavier Del Campo Romero 2022-06-11 23:55:07 +02:00
parent a826c2364d
commit 5794dbf403
1 changed files with 2 additions and 1 deletions

View File

@ -69,11 +69,12 @@ set(interfaces
)
target_compile_options(${PROJECT_NAME} PUBLIC ${cflags})
# Dependencies for main.c
target_link_libraries(${PROJECT_NAME} PRIVATE system game)
foreach(c ${components})
add_subdirectory("src/${c}")
target_compile_options(${c} PUBLIC ${cflags})
target_link_libraries(${PROJECT_NAME} PRIVATE ${c})
endforeach()
foreach(i ${interfaces})