From d2b503910f5970c540e3e5af8c542c08bc935742 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 2 Dec 2024 03:44:18 +0200 Subject: [PATCH] userspace: fix aoc2023 and aoc2024 linking This patch makes aoc projects not link against system libc but the cmake libc target. This allows compilation before libc is installed --- userspace/aoc2023/CMakeLists.txt | 3 +++ userspace/aoc2024/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/userspace/aoc2023/CMakeLists.txt b/userspace/aoc2023/CMakeLists.txt index 7f6c4b06..dc23b2af 100644 --- a/userspace/aoc2023/CMakeLists.txt +++ b/userspace/aoc2023/CMakeLists.txt @@ -41,6 +41,9 @@ endforeach() foreach(AOC2023_PROJECT ${AOC2023_PROJECTS}) add_subdirectory(${AOC2023_PROJECT}) add_dependencies(aoc2023 aoc2023_${AOC2023_PROJECT}) + + target_link_options(aoc2023_${AOC2023_PROJECT} PRIVATE -nolibc) + target_compile_options(aoc2023_${AOC2023_PROJECT} PRIVATE -g -O2 -Wall -Wextra -Werror) endforeach() add_dependencies(userspace aoc2023) diff --git a/userspace/aoc2024/CMakeLists.txt b/userspace/aoc2024/CMakeLists.txt index ed25e161..7bf62281 100644 --- a/userspace/aoc2024/CMakeLists.txt +++ b/userspace/aoc2024/CMakeLists.txt @@ -19,6 +19,9 @@ endforeach() foreach(AOC2024_PROJECT ${AOC2024_PROJECTS}) add_subdirectory(${AOC2024_PROJECT}) add_dependencies(aoc2024 aoc2024_${AOC2024_PROJECT}) + + target_link_options(aoc2024_${AOC2024_PROJECT} PRIVATE -nolibc) + target_compile_options(aoc2024_${AOC2024_PROJECT} PRIVATE -g -O2 -Wall -Wextra -Werror) endforeach() add_dependencies(userspace aoc2024)