From 9e1b5cbaab4c112e75c4b3e8701466e62f2be65f Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 20 Jun 2024 14:32:05 +0300 Subject: [PATCH] BuildSystem: Cleanup CMake code to allow libc only installation There was no way to just install libc which is required for stdlibc++ --- BAN/CMakeLists.txt | 2 +- CMakeLists.txt | 7 ++++--- kernel/CMakeLists.txt | 2 +- script/build.sh | 2 +- toolchain/build.sh | 5 +++-- userspace/Shell/CMakeLists.txt | 2 +- userspace/Terminal/CMakeLists.txt | 2 +- userspace/WindowServer/CMakeLists.txt | 2 +- userspace/aoc2023/day-template/CMakeLists.txt | 2 +- userspace/aoc2023/day1/CMakeLists.txt | 2 +- userspace/aoc2023/day10/CMakeLists.txt | 2 +- userspace/aoc2023/day11/CMakeLists.txt | 2 +- userspace/aoc2023/day12/CMakeLists.txt | 2 +- userspace/aoc2023/day13/CMakeLists.txt | 2 +- userspace/aoc2023/day14/CMakeLists.txt | 2 +- userspace/aoc2023/day15/CMakeLists.txt | 2 +- userspace/aoc2023/day16/CMakeLists.txt | 2 +- userspace/aoc2023/day17/CMakeLists.txt | 2 +- userspace/aoc2023/day18/CMakeLists.txt | 2 +- userspace/aoc2023/day19/CMakeLists.txt | 2 +- userspace/aoc2023/day2/CMakeLists.txt | 2 +- userspace/aoc2023/day20/CMakeLists.txt | 2 +- userspace/aoc2023/day21/CMakeLists.txt | 2 +- userspace/aoc2023/day22/CMakeLists.txt | 2 +- userspace/aoc2023/day23/CMakeLists.txt | 2 +- userspace/aoc2023/day24/CMakeLists.txt | 2 +- userspace/aoc2023/day25/CMakeLists.txt | 2 +- userspace/aoc2023/day3/CMakeLists.txt | 2 +- userspace/aoc2023/day4/CMakeLists.txt | 2 +- userspace/aoc2023/day5/CMakeLists.txt | 2 +- userspace/aoc2023/day6/CMakeLists.txt | 2 +- userspace/aoc2023/day7/CMakeLists.txt | 2 +- userspace/aoc2023/day8/CMakeLists.txt | 2 +- userspace/aoc2023/day9/CMakeLists.txt | 2 +- userspace/aoc2023/full/CMakeLists.txt | 2 +- userspace/cat-mmap/CMakeLists.txt | 2 +- userspace/cat/CMakeLists.txt | 2 +- userspace/chmod/CMakeLists.txt | 2 +- userspace/cp/CMakeLists.txt | 2 +- userspace/dd/CMakeLists.txt | 2 +- userspace/dhcp-client/CMakeLists.txt | 2 +- userspace/echo/CMakeLists.txt | 2 +- userspace/getopt/CMakeLists.txt | 2 +- userspace/http-server/CMakeLists.txt | 2 +- userspace/id/CMakeLists.txt | 2 +- userspace/image/CMakeLists.txt | 2 +- userspace/init/CMakeLists.txt | 2 +- userspace/libraries/LibC/CMakeLists.txt | 4 ++-- userspace/libraries/LibELF/CMakeLists.txt | 2 +- userspace/libraries/LibFont/CMakeLists.txt | 2 +- userspace/libraries/LibGUI/CMakeLists.txt | 2 +- userspace/libraries/LibImage/CMakeLists.txt | 2 +- userspace/libraries/LibInput/CMakeLists.txt | 2 +- userspace/loadkeys/CMakeLists.txt | 2 +- userspace/ls/CMakeLists.txt | 2 +- userspace/meminfo/CMakeLists.txt | 2 +- userspace/mkdir/CMakeLists.txt | 2 +- userspace/nslookup/CMakeLists.txt | 2 +- userspace/poweroff/CMakeLists.txt | 2 +- userspace/resolver/CMakeLists.txt | 2 +- userspace/rm/CMakeLists.txt | 2 +- userspace/sleep/CMakeLists.txt | 2 +- userspace/snake/CMakeLists.txt | 2 +- userspace/stat/CMakeLists.txt | 2 +- userspace/sudo/CMakeLists.txt | 2 +- userspace/sync/CMakeLists.txt | 2 +- userspace/tee/CMakeLists.txt | 2 +- userspace/test-framebuffer/CMakeLists.txt | 2 +- userspace/test-globals/CMakeLists.txt | 2 +- userspace/test-mmap-shared/CMakeLists.txt | 2 +- userspace/test-mouse/CMakeLists.txt | 2 +- userspace/test-popen/CMakeLists.txt | 2 +- userspace/test-sort/CMakeLists.txt | 2 +- userspace/test-tcp/CMakeLists.txt | 2 +- userspace/test-udp/CMakeLists.txt | 2 +- userspace/test-unix-socket/CMakeLists.txt | 2 +- userspace/test-window/CMakeLists.txt | 2 +- userspace/test/CMakeLists.txt | 2 +- userspace/touch/CMakeLists.txt | 2 +- userspace/u8sum/CMakeLists.txt | 2 +- userspace/whoami/CMakeLists.txt | 2 +- userspace/yes/CMakeLists.txt | 2 +- 82 files changed, 88 insertions(+), 86 deletions(-) diff --git a/BAN/CMakeLists.txt b/BAN/CMakeLists.txt index 3f759c40..feb9f8ec 100644 --- a/BAN/CMakeLists.txt +++ b/BAN/CMakeLists.txt @@ -9,4 +9,4 @@ add_library(ban ${BAN_SOURCES}) banan_link_library(ban libc) banan_install_headers(ban) -install(TARGETS ban) +install(TARGETS ban OPTIONAL) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d5f22d7..1e438964 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ set(CMAKE_INSTALL_LIBDIR ${BANAN_LIB}) set(CMAKE_INSTALL_INCLUDEDIR ${BANAN_INCLUDE}) set(CMAKE_INSTALL_SYSCONF ${BANAN_ETC}) set(CMAKE_INSTALL_MESSAGE NEVER) +set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY True) # include headers of ${library} to ${target} function(banan_include_headers target library) @@ -38,12 +39,12 @@ endfunction() # add install step for all header files of target function(banan_install_headers target) - file(GLOB_RECURSE headers RELATIVE $/include "*.h") + file(GLOB_RECURSE headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/include *.h) foreach(header ${headers}) get_filename_component(subdirectory ${header} DIRECTORY) - install(FILES include/${header} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${subdirectory} OPTIONAL) + install(FILES include/${header} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${subdirectory}) endforeach() - target_include_directories(${target} PRIVATE $/include) + target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) endfunction() add_subdirectory(kernel) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 8fa5f09b..aa9d0f2a 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -212,7 +212,7 @@ banan_include_headers(kernel libinput) banan_install_headers(kernel) set_target_properties(kernel PROPERTIES OUTPUT_NAME banan-os.kernel) -install(TARGETS kernel DESTINATION ${BANAN_BOOT}) +install(TARGETS kernel DESTINATION ${BANAN_BOOT} OPTIONAL) if("${BANAN_ARCH}" STREQUAL "x86_64") set(ELF_FORMAT elf64-x86-64) diff --git a/script/build.sh b/script/build.sh index 22c7e2e2..0b29c373 100755 --- a/script/build.sh +++ b/script/build.sh @@ -46,7 +46,7 @@ build_toolchain () { } create_image () { - build_target bootloader + build_target all build_target install $BANAN_ROOT_DIR/ports/build.sh diff --git a/toolchain/build.sh b/toolchain/build.sh index 6fa384f2..d4584659 100755 --- a/toolchain/build.sh +++ b/toolchain/build.sh @@ -239,7 +239,7 @@ find $BANAN_BUILD_DIR -mindepth 1 -maxdepth 1 ! -name toolchain -exec rm -r {} + # NOTE: we have to manually create initial sysroot with libc headers # since cmake cannot be invoked yet mkdir -p $BANAN_SYSROOT/usr -cp -r $BANAN_ROOT_DIR/libc/include $BANAN_SYSROOT/usr/include +cp -r $BANAN_ROOT_DIR/userspace/libraries/LibC/include $BANAN_SYSROOT/usr/include mkdir -p $BANAN_BUILD_DIR/toolchain @@ -262,7 +262,8 @@ fi if (($BUILD_LIBSTDCPP)); then # delete sysroot and install libc rm -r $BANAN_SYSROOT - $BANAN_SCRIPT_DIR/build.sh libc-install + $BANAN_SCRIPT_DIR/build.sh libc + $BANAN_SCRIPT_DIR/build.sh install build_libstdcpp fi diff --git a/userspace/Shell/CMakeLists.txt b/userspace/Shell/CMakeLists.txt index 206d043b..3d243d84 100644 --- a/userspace/Shell/CMakeLists.txt +++ b/userspace/Shell/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(Shell ${SOURCES}) banan_link_library(Shell ban) banan_link_library(Shell libc) -install(TARGETS Shell) +install(TARGETS Shell OPTIONAL) diff --git a/userspace/Terminal/CMakeLists.txt b/userspace/Terminal/CMakeLists.txt index 9c39342a..4ba92d82 100644 --- a/userspace/Terminal/CMakeLists.txt +++ b/userspace/Terminal/CMakeLists.txt @@ -10,4 +10,4 @@ banan_link_library(Terminal libfont) banan_link_library(Terminal libgui) banan_link_library(Terminal libinput) -install(TARGETS Terminal) +install(TARGETS Terminal OPTIONAL) diff --git a/userspace/WindowServer/CMakeLists.txt b/userspace/WindowServer/CMakeLists.txt index d7df2bde..7bc7674e 100644 --- a/userspace/WindowServer/CMakeLists.txt +++ b/userspace/WindowServer/CMakeLists.txt @@ -13,4 +13,4 @@ banan_link_library(WindowServer libfont) banan_link_library(WindowServer libimage) banan_link_library(WindowServer libinput) -install(TARGETS WindowServer) +install(TARGETS WindowServer OPTIONAL) diff --git a/userspace/aoc2023/day-template/CMakeLists.txt b/userspace/aoc2023/day-template/CMakeLists.txt index fa588c32..2512eba1 100644 --- a/userspace/aoc2023/day-template/CMakeLists.txt +++ b/userspace/aoc2023/day-template/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day-template ${SOURCES}) banan_include_headers(aoc2023_day-template ban) banan_link_library(aoc2023_day-template libc) -install(TARGETS aoc2023_day-template) +install(TARGETS aoc2023_day-template OPTIONAL) diff --git a/userspace/aoc2023/day1/CMakeLists.txt b/userspace/aoc2023/day1/CMakeLists.txt index d91a19e3..8b49ab97 100644 --- a/userspace/aoc2023/day1/CMakeLists.txt +++ b/userspace/aoc2023/day1/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day1 ${SOURCES}) banan_include_headers(aoc2023_day1 ban) banan_link_library(aoc2023_day1 libc) -install(TARGETS aoc2023_day1) +install(TARGETS aoc2023_day1 OPTIONAL) diff --git a/userspace/aoc2023/day10/CMakeLists.txt b/userspace/aoc2023/day10/CMakeLists.txt index f9bfd51b..7786435f 100644 --- a/userspace/aoc2023/day10/CMakeLists.txt +++ b/userspace/aoc2023/day10/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day10 ${SOURCES}) banan_include_headers(aoc2023_day10 ban) banan_link_library(aoc2023_day10 libc) -install(TARGETS aoc2023_day10) +install(TARGETS aoc2023_day10 OPTIONAL) diff --git a/userspace/aoc2023/day11/CMakeLists.txt b/userspace/aoc2023/day11/CMakeLists.txt index 2b0191e3..702b6c20 100644 --- a/userspace/aoc2023/day11/CMakeLists.txt +++ b/userspace/aoc2023/day11/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day11 ${SOURCES}) banan_include_headers(aoc2023_day11 ban) banan_link_library(aoc2023_day11 libc) -install(TARGETS aoc2023_day11) +install(TARGETS aoc2023_day11 OPTIONAL) diff --git a/userspace/aoc2023/day12/CMakeLists.txt b/userspace/aoc2023/day12/CMakeLists.txt index 03ae6b99..e72909a0 100644 --- a/userspace/aoc2023/day12/CMakeLists.txt +++ b/userspace/aoc2023/day12/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day12 ${SOURCES}) banan_link_library(aoc2023_day12 ban) banan_link_library(aoc2023_day12 libc) -install(TARGETS aoc2023_day12) +install(TARGETS aoc2023_day12 OPTIONAL) diff --git a/userspace/aoc2023/day13/CMakeLists.txt b/userspace/aoc2023/day13/CMakeLists.txt index 4aafcac7..f3b33881 100644 --- a/userspace/aoc2023/day13/CMakeLists.txt +++ b/userspace/aoc2023/day13/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day13 ${SOURCES}) banan_include_headers(aoc2023_day13 ban) banan_link_library(aoc2023_day13 libc) -install(TARGETS aoc2023_day13) +install(TARGETS aoc2023_day13 OPTIONAL) diff --git a/userspace/aoc2023/day14/CMakeLists.txt b/userspace/aoc2023/day14/CMakeLists.txt index 0d6d273e..b44b3a18 100644 --- a/userspace/aoc2023/day14/CMakeLists.txt +++ b/userspace/aoc2023/day14/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day14 ${SOURCES}) banan_include_headers(aoc2023_day14 ban) banan_link_library(aoc2023_day14 libc) -install(TARGETS aoc2023_day14) +install(TARGETS aoc2023_day14 OPTIONAL) diff --git a/userspace/aoc2023/day15/CMakeLists.txt b/userspace/aoc2023/day15/CMakeLists.txt index 4d845a76..25794449 100644 --- a/userspace/aoc2023/day15/CMakeLists.txt +++ b/userspace/aoc2023/day15/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day15 ${SOURCES}) banan_include_headers(aoc2023_day15 ban) banan_link_library(aoc2023_day15 libc) -install(TARGETS aoc2023_day15) +install(TARGETS aoc2023_day15 OPTIONAL) diff --git a/userspace/aoc2023/day16/CMakeLists.txt b/userspace/aoc2023/day16/CMakeLists.txt index dafa1913..7dc8f300 100644 --- a/userspace/aoc2023/day16/CMakeLists.txt +++ b/userspace/aoc2023/day16/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day16 ${SOURCES}) banan_include_headers(aoc2023_day16 ban) banan_link_library(aoc2023_day16 libc) -install(TARGETS aoc2023_day16) +install(TARGETS aoc2023_day16 OPTIONAL) diff --git a/userspace/aoc2023/day17/CMakeLists.txt b/userspace/aoc2023/day17/CMakeLists.txt index e3e8204d..6d73efeb 100644 --- a/userspace/aoc2023/day17/CMakeLists.txt +++ b/userspace/aoc2023/day17/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day17 ${SOURCES}) banan_include_headers(aoc2023_day17 ban) banan_link_library(aoc2023_day17 libc) -install(TARGETS aoc2023_day17) +install(TARGETS aoc2023_day17 OPTIONAL) diff --git a/userspace/aoc2023/day18/CMakeLists.txt b/userspace/aoc2023/day18/CMakeLists.txt index 850c47bf..5186776e 100644 --- a/userspace/aoc2023/day18/CMakeLists.txt +++ b/userspace/aoc2023/day18/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day18 ${SOURCES}) banan_include_headers(aoc2023_day18 ban) banan_link_library(aoc2023_day18 libc) -install(TARGETS aoc2023_day18) +install(TARGETS aoc2023_day18 OPTIONAL) diff --git a/userspace/aoc2023/day19/CMakeLists.txt b/userspace/aoc2023/day19/CMakeLists.txt index 6310da71..573048cc 100644 --- a/userspace/aoc2023/day19/CMakeLists.txt +++ b/userspace/aoc2023/day19/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day19 ${SOURCES}) banan_include_headers(aoc2023_day19 ban) banan_link_library(aoc2023_day19 libc) -install(TARGETS aoc2023_day19) +install(TARGETS aoc2023_day19 OPTIONAL) diff --git a/userspace/aoc2023/day2/CMakeLists.txt b/userspace/aoc2023/day2/CMakeLists.txt index 2ac2f804..7cc36eed 100644 --- a/userspace/aoc2023/day2/CMakeLists.txt +++ b/userspace/aoc2023/day2/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day2 ${SOURCES}) banan_include_headers(aoc2023_day2 ban) banan_link_library(aoc2023_day2 libc) -install(TARGETS aoc2023_day2) +install(TARGETS aoc2023_day2 OPTIONAL) diff --git a/userspace/aoc2023/day20/CMakeLists.txt b/userspace/aoc2023/day20/CMakeLists.txt index e95d111a..5d30a521 100644 --- a/userspace/aoc2023/day20/CMakeLists.txt +++ b/userspace/aoc2023/day20/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day20 ${SOURCES}) banan_link_library(aoc2023_day20 ban) banan_link_library(aoc2023_day20 libc) -install(TARGETS aoc2023_day20) +install(TARGETS aoc2023_day20 OPTIONAL) diff --git a/userspace/aoc2023/day21/CMakeLists.txt b/userspace/aoc2023/day21/CMakeLists.txt index d519a999..2ca947b8 100644 --- a/userspace/aoc2023/day21/CMakeLists.txt +++ b/userspace/aoc2023/day21/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day21 ${SOURCES}) banan_include_headers(aoc2023_day21 ban) banan_link_library(aoc2023_day21 libc) -install(TARGETS aoc2023_day21) +install(TARGETS aoc2023_day21 OPTIONAL) diff --git a/userspace/aoc2023/day22/CMakeLists.txt b/userspace/aoc2023/day22/CMakeLists.txt index fb7efd87..2614c3e7 100644 --- a/userspace/aoc2023/day22/CMakeLists.txt +++ b/userspace/aoc2023/day22/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day22 ${SOURCES}) banan_include_headers(aoc2023_day22 ban) banan_link_library(aoc2023_day22 libc) -install(TARGETS aoc2023_day22) +install(TARGETS aoc2023_day22 OPTIONAL) diff --git a/userspace/aoc2023/day23/CMakeLists.txt b/userspace/aoc2023/day23/CMakeLists.txt index 83675ac2..e8792182 100644 --- a/userspace/aoc2023/day23/CMakeLists.txt +++ b/userspace/aoc2023/day23/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day23 ${SOURCES}) banan_include_headers(aoc2023_day23 ban) banan_link_library(aoc2023_day23 libc) -install(TARGETS aoc2023_day23) +install(TARGETS aoc2023_day23 OPTIONAL) diff --git a/userspace/aoc2023/day24/CMakeLists.txt b/userspace/aoc2023/day24/CMakeLists.txt index 16638384..86c389e5 100644 --- a/userspace/aoc2023/day24/CMakeLists.txt +++ b/userspace/aoc2023/day24/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day24 ${SOURCES}) banan_include_headers(aoc2023_day24 ban) banan_link_library(aoc2023_day24 libc) -install(TARGETS aoc2023_day24) +install(TARGETS aoc2023_day24 OPTIONAL) diff --git a/userspace/aoc2023/day25/CMakeLists.txt b/userspace/aoc2023/day25/CMakeLists.txt index f40143d0..2acbae95 100644 --- a/userspace/aoc2023/day25/CMakeLists.txt +++ b/userspace/aoc2023/day25/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day25 ${SOURCES}) banan_link_library(aoc2023_day25 ban) banan_link_library(aoc2023_day25 libc) -install(TARGETS aoc2023_day25) +install(TARGETS aoc2023_day25 OPTIONAL) diff --git a/userspace/aoc2023/day3/CMakeLists.txt b/userspace/aoc2023/day3/CMakeLists.txt index 1b0d615a..c8fed7ca 100644 --- a/userspace/aoc2023/day3/CMakeLists.txt +++ b/userspace/aoc2023/day3/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day3 ${SOURCES}) banan_include_headers(aoc2023_day3 ban) banan_link_library(aoc2023_day3 libc) -install(TARGETS aoc2023_day3) +install(TARGETS aoc2023_day3 OPTIONAL) diff --git a/userspace/aoc2023/day4/CMakeLists.txt b/userspace/aoc2023/day4/CMakeLists.txt index d2802650..752d27fb 100644 --- a/userspace/aoc2023/day4/CMakeLists.txt +++ b/userspace/aoc2023/day4/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day4 ${SOURCES}) banan_link_library(aoc2023_day4 ban) banan_link_library(aoc2023_day4 libc) -install(TARGETS aoc2023_day4) +install(TARGETS aoc2023_day4 OPTIONAL) diff --git a/userspace/aoc2023/day5/CMakeLists.txt b/userspace/aoc2023/day5/CMakeLists.txt index fb2da9ae..ff2200fd 100644 --- a/userspace/aoc2023/day5/CMakeLists.txt +++ b/userspace/aoc2023/day5/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day5 ${SOURCES}) banan_include_headers(aoc2023_day5 ban) banan_link_library(aoc2023_day5 libc) -install(TARGETS aoc2023_day5) +install(TARGETS aoc2023_day5 OPTIONAL) diff --git a/userspace/aoc2023/day6/CMakeLists.txt b/userspace/aoc2023/day6/CMakeLists.txt index b584e78e..ab9c17cc 100644 --- a/userspace/aoc2023/day6/CMakeLists.txt +++ b/userspace/aoc2023/day6/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day6 ${SOURCES}) banan_include_headers(aoc2023_day6 ban) banan_link_library(aoc2023_day6 libc) -install(TARGETS aoc2023_day6) +install(TARGETS aoc2023_day6 OPTIONAL) diff --git a/userspace/aoc2023/day7/CMakeLists.txt b/userspace/aoc2023/day7/CMakeLists.txt index f88ce3e8..2f591c73 100644 --- a/userspace/aoc2023/day7/CMakeLists.txt +++ b/userspace/aoc2023/day7/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day7 ${SOURCES}) banan_include_headers(aoc2023_day7 ban) banan_link_library(aoc2023_day7 libc) -install(TARGETS aoc2023_day7) +install(TARGETS aoc2023_day7 OPTIONAL) diff --git a/userspace/aoc2023/day8/CMakeLists.txt b/userspace/aoc2023/day8/CMakeLists.txt index a738ad8c..14d356e0 100644 --- a/userspace/aoc2023/day8/CMakeLists.txt +++ b/userspace/aoc2023/day8/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day8 ${SOURCES}) banan_include_headers(aoc2023_day8 ban) banan_link_library(aoc2023_day8 libc) -install(TARGETS aoc2023_day8) +install(TARGETS aoc2023_day8 OPTIONAL) diff --git a/userspace/aoc2023/day9/CMakeLists.txt b/userspace/aoc2023/day9/CMakeLists.txt index 02836e41..565930ed 100644 --- a/userspace/aoc2023/day9/CMakeLists.txt +++ b/userspace/aoc2023/day9/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_day9 ${SOURCES}) banan_include_headers(aoc2023_day9 ban) banan_link_library(aoc2023_day9 libc) -install(TARGETS aoc2023_day9) +install(TARGETS aoc2023_day9 OPTIONAL) diff --git a/userspace/aoc2023/full/CMakeLists.txt b/userspace/aoc2023/full/CMakeLists.txt index 0cc52df6..dc5aafe6 100644 --- a/userspace/aoc2023/full/CMakeLists.txt +++ b/userspace/aoc2023/full/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(aoc2023_full ${SOURCES}) banan_include_headers(aoc2023_full ban) banan_link_library(aoc2023_full libc) -install(TARGETS aoc2023_full) +install(TARGETS aoc2023_full OPTIONAL) diff --git a/userspace/cat-mmap/CMakeLists.txt b/userspace/cat-mmap/CMakeLists.txt index 8f0298af..f6370103 100644 --- a/userspace/cat-mmap/CMakeLists.txt +++ b/userspace/cat-mmap/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(cat-mmap ${SOURCES}) banan_link_library(cat-mmap libc) -install(TARGETS cat-mmap) +install(TARGETS cat-mmap OPTIONAL) diff --git a/userspace/cat/CMakeLists.txt b/userspace/cat/CMakeLists.txt index a0e8ee97..9d084dc2 100644 --- a/userspace/cat/CMakeLists.txt +++ b/userspace/cat/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(cat ${SOURCES}) banan_link_library(cat libc) -install(TARGETS cat) +install(TARGETS cat OPTIONAL) diff --git a/userspace/chmod/CMakeLists.txt b/userspace/chmod/CMakeLists.txt index 53b91dc8..d3cb1c5f 100644 --- a/userspace/chmod/CMakeLists.txt +++ b/userspace/chmod/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(chmod ${SOURCES}) banan_link_library(chmod libc) -install(TARGETS chmod) +install(TARGETS chmod OPTIONAL) diff --git a/userspace/cp/CMakeLists.txt b/userspace/cp/CMakeLists.txt index a4b4e03a..25f24ca3 100644 --- a/userspace/cp/CMakeLists.txt +++ b/userspace/cp/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(cp ${SOURCES}) banan_include_headers(cp ban) banan_link_library(cp libc) -install(TARGETS cp) +install(TARGETS cp OPTIONAL) diff --git a/userspace/dd/CMakeLists.txt b/userspace/dd/CMakeLists.txt index 7c3da0c5..9d09cde1 100644 --- a/userspace/dd/CMakeLists.txt +++ b/userspace/dd/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(dd ${SOURCES}) banan_link_library(dd libc) -install(TARGETS dd) +install(TARGETS dd OPTIONAL) diff --git a/userspace/dhcp-client/CMakeLists.txt b/userspace/dhcp-client/CMakeLists.txt index b02731a0..c02b3426 100644 --- a/userspace/dhcp-client/CMakeLists.txt +++ b/userspace/dhcp-client/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(dhcp-client ${SOURCES}) banan_include_headers(dhcp-client ban) banan_link_library(dhcp-client libc) -install(TARGETS dhcp-client) +install(TARGETS dhcp-client OPTIONAL) diff --git a/userspace/echo/CMakeLists.txt b/userspace/echo/CMakeLists.txt index 638a3caa..231cfe5d 100644 --- a/userspace/echo/CMakeLists.txt +++ b/userspace/echo/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(echo ${SOURCES}) banan_link_library(echo libc) -install(TARGETS echo) +install(TARGETS echo OPTIONAL) diff --git a/userspace/getopt/CMakeLists.txt b/userspace/getopt/CMakeLists.txt index 08ad357e..80d66e94 100644 --- a/userspace/getopt/CMakeLists.txt +++ b/userspace/getopt/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(getopt ${SOURCES}) banan_include_headers(getopt ban) banan_link_library(getopt libc) -install(TARGETS getopt) +install(TARGETS getopt OPTIONAL) diff --git a/userspace/http-server/CMakeLists.txt b/userspace/http-server/CMakeLists.txt index 778ef7b0..3c5928e1 100644 --- a/userspace/http-server/CMakeLists.txt +++ b/userspace/http-server/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(http-server ${SOURCES}) banan_link_library(http-server ban) banan_link_library(http-server libc) -install(TARGETS http-server) +install(TARGETS http-server OPTIONAL) diff --git a/userspace/id/CMakeLists.txt b/userspace/id/CMakeLists.txt index d301ca59..142c5862 100644 --- a/userspace/id/CMakeLists.txt +++ b/userspace/id/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(id ${SOURCES}) banan_include_headers(id ban) banan_link_library(id libc) -install(TARGETS id) +install(TARGETS id OPTIONAL) diff --git a/userspace/image/CMakeLists.txt b/userspace/image/CMakeLists.txt index 84eafe0f..8ae61699 100644 --- a/userspace/image/CMakeLists.txt +++ b/userspace/image/CMakeLists.txt @@ -7,4 +7,4 @@ banan_include_headers(image ban) banan_link_library(image libc) banan_link_library(image libimage) -install(TARGETS image) +install(TARGETS image OPTIONAL) diff --git a/userspace/init/CMakeLists.txt b/userspace/init/CMakeLists.txt index 09f0f913..499e07a1 100644 --- a/userspace/init/CMakeLists.txt +++ b/userspace/init/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(init ${SOURCES}) banan_include_headers(init ban) banan_link_library(init libc) -install(TARGETS init) +install(TARGETS init OPTIONAL) diff --git a/userspace/libraries/LibC/CMakeLists.txt b/userspace/libraries/LibC/CMakeLists.txt index 99edf159..163c394f 100644 --- a/userspace/libraries/LibC/CMakeLists.txt +++ b/userspace/libraries/LibC/CMakeLists.txt @@ -32,7 +32,7 @@ set(LIBC_SOURCES ) add_library(libc ${LIBC_SOURCES}) -target_compile_options(libc PRIVATE -O2 -g -Wstack-usage=512 -fno-tree-loop-distribute-patterns) +target_compile_options(libc PRIVATE -O2 -g -Wstack-usage=512 -fno-tree-loop-distribute-patterns -nostdlib) target_compile_options(libc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=) add_library(crt0 OBJECT arch/${BANAN_ARCH}/crt0.S) @@ -49,6 +49,6 @@ banan_include_headers(libc ban) banan_include_headers(libc kernel) banan_install_headers(libc) -install(TARGETS libc) +install(TARGETS libc OPTIONAL) set(CMAKE_STATIC_LIBRARY_PREFIX "") diff --git a/userspace/libraries/LibELF/CMakeLists.txt b/userspace/libraries/LibELF/CMakeLists.txt index ffe8b45b..e478f41e 100644 --- a/userspace/libraries/LibELF/CMakeLists.txt +++ b/userspace/libraries/LibELF/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_library(libelf ${SOURCES}) banan_install_headers(libelf) -install(TARGETS libelf) +install(TARGETS libelf OPTIONAL) diff --git a/userspace/libraries/LibFont/CMakeLists.txt b/userspace/libraries/LibFont/CMakeLists.txt index d433b36a..d33a8122 100644 --- a/userspace/libraries/LibFont/CMakeLists.txt +++ b/userspace/libraries/LibFont/CMakeLists.txt @@ -8,6 +8,6 @@ banan_link_library(libfont libc) banan_link_library(libfont ban) banan_install_headers(libfont) -install(TARGETS libfont) +install(TARGETS libfont OPTIONAL) set(CMAKE_STATIC_LIBRARY_PREFIX "") diff --git a/userspace/libraries/LibGUI/CMakeLists.txt b/userspace/libraries/LibGUI/CMakeLists.txt index 9a96c0f9..5cbfdf5e 100644 --- a/userspace/libraries/LibGUI/CMakeLists.txt +++ b/userspace/libraries/LibGUI/CMakeLists.txt @@ -9,6 +9,6 @@ banan_include_headers(libgui libinput) banan_link_library(libgui libc) banan_install_headers(libgui) -install(TARGETS libgui) +install(TARGETS libgui OPTIONAL) set(CMAKE_STATIC_LIBRARY_PREFIX "") diff --git a/userspace/libraries/LibImage/CMakeLists.txt b/userspace/libraries/LibImage/CMakeLists.txt index 418581c1..019549ea 100644 --- a/userspace/libraries/LibImage/CMakeLists.txt +++ b/userspace/libraries/LibImage/CMakeLists.txt @@ -10,6 +10,6 @@ banan_link_library(libimage libc) banan_link_library(libimage ban) banan_install_headers(libimage) -install(TARGETS libimage) +install(TARGETS libimage OPTIONAL) set(CMAKE_STATIC_LIBRARY_PREFIX "") diff --git a/userspace/libraries/LibInput/CMakeLists.txt b/userspace/libraries/LibInput/CMakeLists.txt index dd075eb0..ed3d02a2 100644 --- a/userspace/libraries/LibInput/CMakeLists.txt +++ b/userspace/libraries/LibInput/CMakeLists.txt @@ -8,6 +8,6 @@ banan_include_headers(libinput ban) banan_link_library(libinput libc) banan_install_headers(libinput) -install(TARGETS libinput) +install(TARGETS libinput OPTIONAL) set(CMAKE_STATIC_LIBRARY_PREFIX "") diff --git a/userspace/loadkeys/CMakeLists.txt b/userspace/loadkeys/CMakeLists.txt index dd6d7a34..7cd4fcda 100644 --- a/userspace/loadkeys/CMakeLists.txt +++ b/userspace/loadkeys/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(loadkeys ${SOURCES}) banan_link_library(loadkeys libc) -install(TARGETS loadkeys) +install(TARGETS loadkeys OPTIONAL) diff --git a/userspace/ls/CMakeLists.txt b/userspace/ls/CMakeLists.txt index d1fa310a..316ff7c8 100644 --- a/userspace/ls/CMakeLists.txt +++ b/userspace/ls/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(ls ${SOURCES}) banan_link_library(ls ban) banan_link_library(ls libc) -install(TARGETS ls) +install(TARGETS ls OPTIONAL) diff --git a/userspace/meminfo/CMakeLists.txt b/userspace/meminfo/CMakeLists.txt index fd5339cf..d79e80d3 100644 --- a/userspace/meminfo/CMakeLists.txt +++ b/userspace/meminfo/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(meminfo ${SOURCES}) banan_link_library(meminfo libc) -install(TARGETS meminfo) +install(TARGETS meminfo OPTIONAL) diff --git a/userspace/mkdir/CMakeLists.txt b/userspace/mkdir/CMakeLists.txt index 38fbda31..2d66513c 100644 --- a/userspace/mkdir/CMakeLists.txt +++ b/userspace/mkdir/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(mkdir ${SOURCES}) banan_link_library(mkdir libc) -install(TARGETS mkdir) +install(TARGETS mkdir OPTIONAL) diff --git a/userspace/nslookup/CMakeLists.txt b/userspace/nslookup/CMakeLists.txt index c251bb2f..19f64db2 100644 --- a/userspace/nslookup/CMakeLists.txt +++ b/userspace/nslookup/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(nslookup ${SOURCES}) banan_link_library(nslookup libc) -install(TARGETS nslookup) +install(TARGETS nslookup OPTIONAL) diff --git a/userspace/poweroff/CMakeLists.txt b/userspace/poweroff/CMakeLists.txt index 81c3f74c..891141e1 100644 --- a/userspace/poweroff/CMakeLists.txt +++ b/userspace/poweroff/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(poweroff ${SOURCES}) banan_link_library(poweroff libc) -install(TARGETS poweroff) +install(TARGETS poweroff OPTIONAL) diff --git a/userspace/resolver/CMakeLists.txt b/userspace/resolver/CMakeLists.txt index 23a8cc1c..ca488ed9 100644 --- a/userspace/resolver/CMakeLists.txt +++ b/userspace/resolver/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(resolver ${SOURCES}) banan_link_library(resolver ban) banan_link_library(resolver libc) -install(TARGETS resolver) +install(TARGETS resolver OPTIONAL) diff --git a/userspace/rm/CMakeLists.txt b/userspace/rm/CMakeLists.txt index 9213a551..2c590c53 100644 --- a/userspace/rm/CMakeLists.txt +++ b/userspace/rm/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(rm ${SOURCES}) banan_include_headers(rm ban) banan_link_library(rm libc) -install(TARGETS rm) +install(TARGETS rm OPTIONAL) diff --git a/userspace/sleep/CMakeLists.txt b/userspace/sleep/CMakeLists.txt index 3efe450f..174c0227 100644 --- a/userspace/sleep/CMakeLists.txt +++ b/userspace/sleep/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(sleep ${SOURCES}) banan_link_library(sleep libc) -install(TARGETS sleep) +install(TARGETS sleep OPTIONAL) diff --git a/userspace/snake/CMakeLists.txt b/userspace/snake/CMakeLists.txt index 66e4059e..efb87de6 100644 --- a/userspace/snake/CMakeLists.txt +++ b/userspace/snake/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(snake ${SOURCES}) banan_include_headers(snake ban) banan_link_library(snake libc) -install(TARGETS snake) +install(TARGETS snake OPTIONAL) diff --git a/userspace/stat/CMakeLists.txt b/userspace/stat/CMakeLists.txt index 2b539b21..70d56119 100644 --- a/userspace/stat/CMakeLists.txt +++ b/userspace/stat/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(stat ${SOURCES}) banan_link_library(stat ban) banan_link_library(stat libc) -install(TARGETS stat) +install(TARGETS stat OPTIONAL) diff --git a/userspace/sudo/CMakeLists.txt b/userspace/sudo/CMakeLists.txt index f1166923..fd0277ba 100644 --- a/userspace/sudo/CMakeLists.txt +++ b/userspace/sudo/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(sudo ${SOURCES}) banan_link_library(sudo libc) -install(TARGETS sudo) +install(TARGETS sudo OPTIONAL) diff --git a/userspace/sync/CMakeLists.txt b/userspace/sync/CMakeLists.txt index 307481f5..628200b0 100644 --- a/userspace/sync/CMakeLists.txt +++ b/userspace/sync/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(sync ${SOURCES}) banan_link_library(sync libc) -install(TARGETS sync) +install(TARGETS sync OPTIONAL) diff --git a/userspace/tee/CMakeLists.txt b/userspace/tee/CMakeLists.txt index 7962c169..0288a76c 100644 --- a/userspace/tee/CMakeLists.txt +++ b/userspace/tee/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(tee ${SOURCES}) banan_link_library(tee libc) -install(TARGETS tee) +install(TARGETS tee OPTIONAL) diff --git a/userspace/test-framebuffer/CMakeLists.txt b/userspace/test-framebuffer/CMakeLists.txt index fa8c2f13..a7f09aa2 100644 --- a/userspace/test-framebuffer/CMakeLists.txt +++ b/userspace/test-framebuffer/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(test-framebuffer ${SOURCES}) banan_link_library(test-framebuffer libc) -install(TARGETS test-framebuffer) +install(TARGETS test-framebuffer OPTIONAL) diff --git a/userspace/test-globals/CMakeLists.txt b/userspace/test-globals/CMakeLists.txt index ad9ab946..24caa441 100644 --- a/userspace/test-globals/CMakeLists.txt +++ b/userspace/test-globals/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(test-globals ${SOURCES}) banan_link_library(test-globals libc) -install(TARGETS test-globals) +install(TARGETS test-globals OPTIONAL) diff --git a/userspace/test-mmap-shared/CMakeLists.txt b/userspace/test-mmap-shared/CMakeLists.txt index 29d9e930..d97591d4 100644 --- a/userspace/test-mmap-shared/CMakeLists.txt +++ b/userspace/test-mmap-shared/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(test-mmap-shared ${SOURCES}) banan_link_library(test-mmap-shared libc) -install(TARGETS test-mmap-shared) +install(TARGETS test-mmap-shared OPTIONAL) diff --git a/userspace/test-mouse/CMakeLists.txt b/userspace/test-mouse/CMakeLists.txt index 2060258e..fe117f2b 100644 --- a/userspace/test-mouse/CMakeLists.txt +++ b/userspace/test-mouse/CMakeLists.txt @@ -7,4 +7,4 @@ banan_include_headers(test-mouse ban) banan_include_headers(test-mouse libinput) banan_link_library(test-mouse libc) -install(TARGETS test-mouse) +install(TARGETS test-mouse OPTIONAL) diff --git a/userspace/test-popen/CMakeLists.txt b/userspace/test-popen/CMakeLists.txt index c475c12a..3ae3d565 100644 --- a/userspace/test-popen/CMakeLists.txt +++ b/userspace/test-popen/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(test-popen ${SOURCES}) banan_link_library(test-popen libc) -install(TARGETS test-popen) +install(TARGETS test-popen OPTIONAL) diff --git a/userspace/test-sort/CMakeLists.txt b/userspace/test-sort/CMakeLists.txt index 96c48bcb..c6e9f8d2 100644 --- a/userspace/test-sort/CMakeLists.txt +++ b/userspace/test-sort/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(test-sort ${SOURCES}) banan_include_headers(test-sort ban) banan_link_library(test-sort libc) -install(TARGETS test-sort) +install(TARGETS test-sort OPTIONAL) diff --git a/userspace/test-tcp/CMakeLists.txt b/userspace/test-tcp/CMakeLists.txt index 519fb2d0..6836da0a 100644 --- a/userspace/test-tcp/CMakeLists.txt +++ b/userspace/test-tcp/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(test-tcp ${SOURCES}) banan_link_library(test-tcp libc) -install(TARGETS test-tcp) +install(TARGETS test-tcp OPTIONAL) diff --git a/userspace/test-udp/CMakeLists.txt b/userspace/test-udp/CMakeLists.txt index 60d3f024..1165a49b 100644 --- a/userspace/test-udp/CMakeLists.txt +++ b/userspace/test-udp/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(test-udp ${SOURCES}) banan_link_library(test-udp libc) -install(TARGETS test-udp) +install(TARGETS test-udp OPTIONAL) diff --git a/userspace/test-unix-socket/CMakeLists.txt b/userspace/test-unix-socket/CMakeLists.txt index 82cbc038..4720fa4a 100644 --- a/userspace/test-unix-socket/CMakeLists.txt +++ b/userspace/test-unix-socket/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(test-unix-socket ${SOURCES}) banan_link_library(test-unix-socket libc) -install(TARGETS test-unix-socket) +install(TARGETS test-unix-socket OPTIONAL) diff --git a/userspace/test-window/CMakeLists.txt b/userspace/test-window/CMakeLists.txt index b0c0857f..94b5205e 100644 --- a/userspace/test-window/CMakeLists.txt +++ b/userspace/test-window/CMakeLists.txt @@ -8,4 +8,4 @@ banan_include_headers(test-window libinput) banan_link_library(test-window libc) banan_link_library(test-window libgui) -install(TARGETS test-window) +install(TARGETS test-window OPTIONAL) diff --git a/userspace/test/CMakeLists.txt b/userspace/test/CMakeLists.txt index 093742db..dac58209 100644 --- a/userspace/test/CMakeLists.txt +++ b/userspace/test/CMakeLists.txt @@ -5,4 +5,4 @@ set(TEST_SOURCES add_executable(test ${TEST_SOURCES}) banan_link_library(test libc) -install(TARGETS test) +install(TARGETS test OPTIONAL) diff --git a/userspace/touch/CMakeLists.txt b/userspace/touch/CMakeLists.txt index 2e93a182..a0ba7c83 100644 --- a/userspace/touch/CMakeLists.txt +++ b/userspace/touch/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(touch ${SOURCES}) banan_link_library(touch libc) -install(TARGETS touch) +install(TARGETS touch OPTIONAL) diff --git a/userspace/u8sum/CMakeLists.txt b/userspace/u8sum/CMakeLists.txt index 3233e3ef..83675131 100644 --- a/userspace/u8sum/CMakeLists.txt +++ b/userspace/u8sum/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(u8sum ${SOURCES}) banan_link_library(u8sum libc) -install(TARGETS u8sum) +install(TARGETS u8sum OPTIONAL) diff --git a/userspace/whoami/CMakeLists.txt b/userspace/whoami/CMakeLists.txt index 106f9616..fa412942 100644 --- a/userspace/whoami/CMakeLists.txt +++ b/userspace/whoami/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(whoami ${SOURCES}) banan_include_headers(whoami ban) banan_link_library(whoami libc) -install(TARGETS whoami) +install(TARGETS whoami OPTIONAL) diff --git a/userspace/yes/CMakeLists.txt b/userspace/yes/CMakeLists.txt index b6ef202c..6da530da 100644 --- a/userspace/yes/CMakeLists.txt +++ b/userspace/yes/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCES add_executable(yes ${SOURCES}) banan_link_library(yes libc) -install(TARGETS yes) +install(TARGETS yes OPTIONAL)