From b2af4c6bccc4263e5c7aa96efd0f94e1b7a38231 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 11 Jun 2022 23:55:07 +0200 Subject: 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. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca23a38..f04b6e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) -- cgit v1.2.3