BuildSystem: Rework the whole cmake build system
Now files are installed using the install() command instead of manually copying files to their destinations. This allows automatic recompilation of headers that did not work previously
This commit is contained in:
parent
318ce5dec8
commit
ad6d95ba52
|
@ -1,7 +1,3 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(BAN CXX)
|
|
||||||
|
|
||||||
set(BAN_SOURCES
|
set(BAN_SOURCES
|
||||||
BAN/Assert.cpp
|
BAN/Assert.cpp
|
||||||
BAN/New.cpp
|
BAN/New.cpp
|
||||||
|
@ -9,16 +5,8 @@ set(BAN_SOURCES
|
||||||
BAN/Time.cpp
|
BAN/Time.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(ban-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(ban ${BAN_SOURCES})
|
add_library(ban ${BAN_SOURCES})
|
||||||
add_dependencies(ban headers libc-install)
|
banan_link_library(ban libc)
|
||||||
|
|
||||||
add_custom_target(ban-install
|
banan_install_headers(ban)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libban.a ${BANAN_LIB}/
|
install(TARGETS ban)
|
||||||
DEPENDS ban
|
|
||||||
BYPRODUCTS ${BANAN_LIB}/libban.a
|
|
||||||
)
|
|
||||||
|
|
|
@ -10,11 +10,41 @@ add_compile_definitions(__enable_sse=1)
|
||||||
project(banan-os CXX C ASM)
|
project(banan-os CXX C ASM)
|
||||||
|
|
||||||
set(BANAN_BASE_SYSROOT ${CMAKE_SOURCE_DIR}/base-sysroot.tar.gz)
|
set(BANAN_BASE_SYSROOT ${CMAKE_SOURCE_DIR}/base-sysroot.tar.gz)
|
||||||
|
|
||||||
set(BANAN_INCLUDE ${BANAN_SYSROOT}/usr/include)
|
set(BANAN_INCLUDE ${BANAN_SYSROOT}/usr/include)
|
||||||
set(BANAN_LIB ${BANAN_SYSROOT}/usr/lib)
|
set(BANAN_LIB ${BANAN_SYSROOT}/usr/lib)
|
||||||
set(BANAN_BIN ${BANAN_SYSROOT}/usr/bin)
|
set(BANAN_BIN ${BANAN_SYSROOT}/usr/bin)
|
||||||
set(BANAN_SHARE ${BANAN_SYSROOT}/usr/share)
|
set(BANAN_ETC ${BANAN_SYSROOT}/usr/etc)
|
||||||
set(BANAN_BOOT ${BANAN_SYSROOT}/boot)
|
set(BANAN_SHARE ${BANAN_SYSROOT}/usr/share)
|
||||||
|
set(BANAN_BOOT ${BANAN_SYSROOT}/boot)
|
||||||
|
|
||||||
|
set(CMAKE_INSTALL_BINDIR ${BANAN_BIN})
|
||||||
|
set(CMAKE_INSTALL_SBINDIR ${BANAN_BIN})
|
||||||
|
set(CMAKE_INSTALL_LIBDIR ${BANAN_LIB})
|
||||||
|
set(CMAKE_INSTALL_INCLUDEDIR ${BANAN_INCLUDE})
|
||||||
|
set(CMAKE_INSTALL_SYSCONF ${BANAN_ETC})
|
||||||
|
set(CMAKE_INSTALL_MESSAGE NEVER)
|
||||||
|
|
||||||
|
# include headers of ${library} to ${target}
|
||||||
|
function(banan_include_headers target library)
|
||||||
|
target_include_directories(${target} PRIVATE $<TARGET_PROPERTY:${library},SOURCE_DIR>/include)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# include headers and link ${library} to ${target}
|
||||||
|
function(banan_link_library target library)
|
||||||
|
target_link_libraries(${target} PRIVATE ${library})
|
||||||
|
banan_include_headers(${target} ${library})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# add install step for all header files of target
|
||||||
|
function(banan_install_headers target)
|
||||||
|
file(GLOB_RECURSE headers RELATIVE $<TARGET_PROPERTY:${target},SOURCE_DIR>/include "*.h")
|
||||||
|
foreach(header ${headers})
|
||||||
|
get_filename_component(subdirectory ${header} DIRECTORY)
|
||||||
|
install(FILES include/${header} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${subdirectory} OPTIONAL)
|
||||||
|
endforeach()
|
||||||
|
target_include_directories(${target} PRIVATE $<TARGET_PROPERTY:${target},SOURCE_DIR>/include)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
add_subdirectory(kernel)
|
add_subdirectory(kernel)
|
||||||
add_subdirectory(bootloader)
|
add_subdirectory(bootloader)
|
||||||
|
@ -25,20 +55,3 @@ add_custom_target(sysroot
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_SYSROOT}
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_SYSROOT}
|
||||||
COMMAND cd ${BANAN_SYSROOT} && tar xf ${BANAN_BASE_SYSROOT}
|
COMMAND cd ${BANAN_SYSROOT} && tar xf ${BANAN_BASE_SYSROOT}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(headers
|
|
||||||
DEPENDS kernel-headers
|
|
||||||
DEPENDS ban-headers
|
|
||||||
DEPENDS userspace-headers
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(install-sysroot
|
|
||||||
DEPENDS kernel-install
|
|
||||||
DEPENDS ban-install
|
|
||||||
DEPENDS userspace-install
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(package-sysroot
|
|
||||||
COMMAND cd ${BANAN_SYSROOT} && tar cf ${BANAN_SYSROOT_TAR} *
|
|
||||||
DEPENDS install-sysroot
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(kernel CXX C ASM)
|
|
||||||
|
|
||||||
if("${BANAN_ARCH}" STREQUAL "x86_64")
|
|
||||||
set(ELF_FORMAT elf64-x86-64)
|
|
||||||
elseif("${BANAN_ARCH}" STREQUAL "i686")
|
|
||||||
set(ELF_FORMAT elf32-i386)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(KERNEL_SOURCES
|
set(KERNEL_SOURCES
|
||||||
font/prefs.psf.o
|
font/prefs.psf.o
|
||||||
kernel/ACPI/ACPI.cpp
|
kernel/ACPI/ACPI.cpp
|
||||||
|
@ -106,7 +96,7 @@ set(KERNEL_SOURCES
|
||||||
icxxabi.cpp
|
icxxabi.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
#set(ENABLE_KERNEL_UBSAN True)
|
set(ENABLE_KERNEL_UBSAN False)
|
||||||
|
|
||||||
if(ENABLE_KERNEL_UBSAN)
|
if(ENABLE_KERNEL_UBSAN)
|
||||||
set(KERNEL_SOURCES ${KERNEL_SOURCES} ubsan.cpp)
|
set(KERNEL_SOURCES ${KERNEL_SOURCES} ubsan.cpp)
|
||||||
|
@ -172,7 +162,6 @@ set(KERNEL_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(kernel ${KERNEL_SOURCES})
|
add_executable(kernel ${KERNEL_SOURCES})
|
||||||
add_dependencies(kernel headers)
|
|
||||||
|
|
||||||
target_compile_definitions(kernel PUBLIC __is_kernel)
|
target_compile_definitions(kernel PUBLIC __is_kernel)
|
||||||
target_compile_definitions(kernel PUBLIC __arch=${BANAN_ARCH})
|
target_compile_definitions(kernel PUBLIC __arch=${BANAN_ARCH})
|
||||||
|
@ -199,16 +188,6 @@ endif()
|
||||||
|
|
||||||
target_link_options(kernel PUBLIC -ffreestanding -nostdlib)
|
target_link_options(kernel PUBLIC -ffreestanding -nostdlib)
|
||||||
|
|
||||||
add_custom_target(kernel-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(kernel-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/kernel ${BANAN_BOOT}/banan-os.kernel
|
|
||||||
DEPENDS kernel
|
|
||||||
)
|
|
||||||
|
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=crtbegin.o OUTPUT_VARIABLE CRTBEGIN OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=crtbegin.o OUTPUT_VARIABLE CRTBEGIN OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=crtend.o OUTPUT_VARIABLE CRTEND OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=crtend.o OUTPUT_VARIABLE CRTEND OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
@ -225,6 +204,22 @@ add_custom_command(
|
||||||
# COMMAND x86_64-banan_os-strip ${CMAKE_CURRENT_BINARY_DIR}/kernel
|
# COMMAND x86_64-banan_os-strip ${CMAKE_CURRENT_BINARY_DIR}/kernel
|
||||||
#)
|
#)
|
||||||
|
|
||||||
|
banan_include_headers(kernel ban)
|
||||||
|
banan_include_headers(kernel libc)
|
||||||
|
banan_include_headers(kernel libfont)
|
||||||
|
banan_include_headers(kernel libelf)
|
||||||
|
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})
|
||||||
|
|
||||||
|
if("${BANAN_ARCH}" STREQUAL "x86_64")
|
||||||
|
set(ELF_FORMAT elf64-x86-64)
|
||||||
|
elseif("${BANAN_ARCH}" STREQUAL "i686")
|
||||||
|
set(ELF_FORMAT elf32-i386)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT font/prefs.psf.o
|
OUTPUT font/prefs.psf.o
|
||||||
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && objcopy -O ${ELF_FORMAT} -B i386 -I binary font/prefs.psf ${CMAKE_CURRENT_BINARY_DIR}/font/prefs.psf.o
|
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && objcopy -O ${ELF_FORMAT} -B i386 -I binary font/prefs.psf ${CMAKE_CURRENT_BINARY_DIR}/font/prefs.psf.o
|
||||||
|
|
|
@ -7,6 +7,9 @@ source $BANAN_SCRIPT_DIR/config.sh
|
||||||
FAKEROOT_FILE="$BANAN_BUILD_DIR/fakeroot-context"
|
FAKEROOT_FILE="$BANAN_BUILD_DIR/fakeroot-context"
|
||||||
|
|
||||||
run_fakeroot() {
|
run_fakeroot() {
|
||||||
|
if [ ! -f $FAKEROOT_FILE ]; then
|
||||||
|
touch $FAKEROOT_FILE
|
||||||
|
fi
|
||||||
fakeroot -i $FAKEROOT_FILE -s $FAKEROOT_FILE -- /bin/bash -c '$@' bash $@
|
fakeroot -i $FAKEROOT_FILE -s $FAKEROOT_FILE -- /bin/bash -c '$@' bash $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,9 +47,14 @@ build_toolchain () {
|
||||||
|
|
||||||
create_image () {
|
create_image () {
|
||||||
build_target bootloader
|
build_target bootloader
|
||||||
build_target install-sysroot
|
build_target install
|
||||||
|
|
||||||
$BANAN_ROOT_DIR/ports/build.sh
|
$BANAN_ROOT_DIR/ports/build.sh
|
||||||
build_target package-sysroot
|
|
||||||
|
pushd $BANAN_SYSROOT >/dev/null
|
||||||
|
run_fakeroot tar cf ${BANAN_SYSROOT_TAR} *
|
||||||
|
popd >/dev/null
|
||||||
|
|
||||||
$BANAN_SCRIPT_DIR/image.sh "$1"
|
$BANAN_SCRIPT_DIR/image.sh "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +114,12 @@ case $1 in
|
||||||
build_target clean
|
build_target clean
|
||||||
rm -f $FAKEROOT_FILE
|
rm -f $FAKEROOT_FILE
|
||||||
rm -rf $BANAN_SYSROOT
|
rm -rf $BANAN_SYSROOT
|
||||||
|
rm -f $BANAN_SYSROOT.tar
|
||||||
rm -f $BANAN_DISK_IMAGE_PATH
|
rm -f $BANAN_DISK_IMAGE_PATH
|
||||||
;;
|
;;
|
||||||
|
distclean)
|
||||||
|
rm -rf $BANAN_BUILD_DIR
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
build_target $1
|
build_target $1
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(userspace CXX)
|
|
||||||
|
|
||||||
set(USERSPACE_PROJECTS
|
set(USERSPACE_PROJECTS
|
||||||
cat
|
cat
|
||||||
cat-mmap
|
cat-mmap
|
||||||
|
@ -18,7 +14,6 @@ set(USERSPACE_PROJECTS
|
||||||
ls
|
ls
|
||||||
meminfo
|
meminfo
|
||||||
mkdir
|
mkdir
|
||||||
mmap-shared-test
|
|
||||||
nslookup
|
nslookup
|
||||||
poweroff
|
poweroff
|
||||||
resolver
|
resolver
|
||||||
|
@ -34,6 +29,7 @@ set(USERSPACE_PROJECTS
|
||||||
test
|
test
|
||||||
test-framebuffer
|
test-framebuffer
|
||||||
test-globals
|
test-globals
|
||||||
|
test-mmap-shared
|
||||||
test-mouse
|
test-mouse
|
||||||
test-popen
|
test-popen
|
||||||
test-sort
|
test-sort
|
||||||
|
@ -50,20 +46,16 @@ set(USERSPACE_PROJECTS
|
||||||
|
|
||||||
add_subdirectory(libraries)
|
add_subdirectory(libraries)
|
||||||
|
|
||||||
foreach(USERSPACE_PROJECT ${USERSPACE_PROJECTS})
|
add_custom_target(userspace)
|
||||||
add_subdirectory(${USERSPACE_PROJECT})
|
|
||||||
endforeach()
|
#add_subdirectory(aoc2023)
|
||||||
|
|
||||||
add_custom_target(userspace DEPENDS libraries)
|
foreach(project ${USERSPACE_PROJECTS})
|
||||||
add_custom_target(userspace-headers DEPENDS libraries-headers)
|
add_subdirectory(${project})
|
||||||
add_custom_target(userspace-install DEPENDS userspace libraries-install)
|
add_dependencies(${project} crtx-install)
|
||||||
|
add_dependencies(userspace ${project})
|
||||||
add_subdirectory(aoc2023)
|
# This is to allow cmake to link when libc updates
|
||||||
|
target_link_options(${project} PRIVATE -nolibc)
|
||||||
foreach(USERSPACE_PROJECT ${USERSPACE_PROJECTS})
|
# Default compile options
|
||||||
target_compile_options(${USERSPACE_PROJECT} PRIVATE -g)
|
target_compile_options(${project} PRIVATE -g -O2)
|
||||||
add_dependencies(userspace ${USERSPACE_PROJECT})
|
|
||||||
add_dependencies(userspace-install ${USERSPACE_PROJECT}-install)
|
|
||||||
|
|
||||||
target_link_options(${USERSPACE_PROJECT} PRIVATE -nolibc)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(Shell CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(Shell ${SOURCES})
|
add_executable(Shell ${SOURCES})
|
||||||
target_compile_options(Shell PUBLIC -O2 -g)
|
banan_link_library(Shell ban)
|
||||||
target_link_libraries(Shell PUBLIC libc ban)
|
banan_link_library(Shell libc)
|
||||||
|
|
||||||
add_custom_target(Shell-install
|
install(TARGETS Shell)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/Shell ${BANAN_BIN}/
|
|
||||||
DEPENDS Shell
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(Terminal CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
Terminal.cpp
|
Terminal.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(Terminal ${SOURCES})
|
add_executable(Terminal ${SOURCES})
|
||||||
target_compile_options(Terminal PUBLIC -O2 -g)
|
banan_include_headers(Terminal ban)
|
||||||
target_link_libraries(Terminal PUBLIC libc ban libfont libgui libinput)
|
banan_link_library(Terminal libc)
|
||||||
|
banan_link_library(Terminal libfont)
|
||||||
|
banan_link_library(Terminal libgui)
|
||||||
|
banan_link_library(Terminal libinput)
|
||||||
|
|
||||||
add_custom_target(Terminal-install
|
install(TARGETS Terminal)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/Terminal ${BANAN_BIN}/
|
|
||||||
DEPENDS Terminal
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(WindowServer CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
Framebuffer.cpp
|
Framebuffer.cpp
|
||||||
|
@ -10,10 +6,11 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(WindowServer ${SOURCES})
|
add_executable(WindowServer ${SOURCES})
|
||||||
target_compile_options(WindowServer PUBLIC -O2 -g)
|
banan_include_headers(WindowServer ban)
|
||||||
target_link_libraries(WindowServer PUBLIC libc ban libfont libgui libimage libinput)
|
banan_include_headers(WindowServer libgui)
|
||||||
|
banan_link_library(WindowServer libc)
|
||||||
|
banan_link_library(WindowServer libfont)
|
||||||
|
banan_link_library(WindowServer libimage)
|
||||||
|
banan_link_library(WindowServer libinput)
|
||||||
|
|
||||||
add_custom_target(WindowServer-install
|
install(TARGETS WindowServer)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/WindowServer ${BANAN_BIN}/
|
|
||||||
DEPENDS WindowServer
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023 CXX)
|
|
||||||
|
|
||||||
set(AOC2023_PROJECTS
|
set(AOC2023_PROJECTS
|
||||||
day1
|
day1
|
||||||
day2
|
day2
|
||||||
|
@ -30,20 +26,21 @@ set(AOC2023_PROJECTS
|
||||||
full
|
full
|
||||||
)
|
)
|
||||||
|
|
||||||
set(BANAN_AOC2023_BIN ${BANAN_BIN}/aoc2023)
|
set(BANAN_AOC2023_BIN ${CMAKE_INSTALL_BINDIR}/aoc2023)
|
||||||
set(BANAN_AOC2023_INPUT ${BANAN_SHARE}/aoc2023)
|
set(BANAN_AOC2023_INPUT ${BANAN_SHARE}/aoc2023)
|
||||||
|
|
||||||
|
set(CMAKE_INSTALL_BINDIR ${BANAN_AOC2023_BIN})
|
||||||
|
|
||||||
add_custom_target(aoc2023)
|
add_custom_target(aoc2023)
|
||||||
add_custom_target(aoc2023_always
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_AOC2023_BIN}
|
file(GLOB_RECURSE input_files "input/*")
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_AOC2023_INPUT}
|
foreach(file ${input_files})
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/input/* ${BANAN_AOC2023_INPUT}/
|
install(FILES ${file} DESTINATION ${BANAN_AOC2023_INPUT})
|
||||||
)
|
endforeach()
|
||||||
add_custom_target(aoc2023-install DEPENDS aoc2023 aoc2023_always)
|
|
||||||
|
|
||||||
foreach(AOC2023_PROJECT ${AOC2023_PROJECTS})
|
foreach(AOC2023_PROJECT ${AOC2023_PROJECTS})
|
||||||
add_subdirectory(${AOC2023_PROJECT})
|
add_subdirectory(${AOC2023_PROJECT})
|
||||||
|
add_dependencies(aoc2023 aoc2023_${AOC2023_PROJECT})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_dependencies(userspace aoc2023)
|
add_dependencies(userspace aoc2023)
|
||||||
add_dependencies(userspace-install aoc2023-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day-template CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day-template ${SOURCES})
|
add_executable(aoc2023_day-template ${SOURCES})
|
||||||
target_compile_options(aoc2023_day-template PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day-template ban)
|
||||||
target_link_libraries(aoc2023_day-template PUBLIC libc ban)
|
banan_link_library(aoc2023_day-template libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day-template libc-install ban-install)
|
install(TARGETS aoc2023_day-template)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day-template-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day-template ${BANAN_AOC2023_BIN}/day-template
|
|
||||||
DEPENDS aoc2023_day-template
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day-template)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day-template-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day1 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day1 ${SOURCES})
|
add_executable(aoc2023_day1 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day1 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day1 ban)
|
||||||
target_link_libraries(aoc2023_day1 PUBLIC libc)
|
banan_link_library(aoc2023_day1 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day1 libc-install ban-install)
|
install(TARGETS aoc2023_day1)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day1-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day1 ${BANAN_AOC2023_BIN}/day1
|
|
||||||
DEPENDS aoc2023_day1
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day1)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day1-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day10 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day10 ${SOURCES})
|
add_executable(aoc2023_day10 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day10 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day10 ban)
|
||||||
target_link_libraries(aoc2023_day10 PUBLIC libc ban)
|
banan_link_library(aoc2023_day10 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day10 libc-install ban-install)
|
install(TARGETS aoc2023_day10)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day10-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day10 ${BANAN_AOC2023_BIN}/day10
|
|
||||||
DEPENDS aoc2023_day10
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day10)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day10-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day11 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day11 ${SOURCES})
|
add_executable(aoc2023_day11 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day11 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day11 ban)
|
||||||
target_link_libraries(aoc2023_day11 PUBLIC libc ban)
|
banan_link_library(aoc2023_day11 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day11 libc-install ban-install)
|
install(TARGETS aoc2023_day11)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day11-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day11 ${BANAN_AOC2023_BIN}/day11
|
|
||||||
DEPENDS aoc2023_day11
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day11)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day11-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day12 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day12 ${SOURCES})
|
add_executable(aoc2023_day12 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day12 PUBLIC -O2 -g)
|
banan_link_library(aoc2023_day12 ban)
|
||||||
target_link_libraries(aoc2023_day12 PUBLIC libc ban)
|
banan_link_library(aoc2023_day12 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day12 libc-install ban-install)
|
install(TARGETS aoc2023_day12)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day12-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day12 ${BANAN_AOC2023_BIN}/day12
|
|
||||||
DEPENDS aoc2023_day12
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day12)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day12-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day13 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day13 ${SOURCES})
|
add_executable(aoc2023_day13 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day13 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day13 ban)
|
||||||
target_link_libraries(aoc2023_day13 PUBLIC libc ban)
|
banan_link_library(aoc2023_day13 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day13 libc-install ban-install)
|
install(TARGETS aoc2023_day13)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day13-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day13 ${BANAN_AOC2023_BIN}/day13
|
|
||||||
DEPENDS aoc2023_day13
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day13)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day13-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day14 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day14 ${SOURCES})
|
add_executable(aoc2023_day14 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day14 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day14 ban)
|
||||||
target_link_libraries(aoc2023_day14 PUBLIC libc ban)
|
banan_link_library(aoc2023_day14 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day14 libc-install ban-install)
|
install(TARGETS aoc2023_day14)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day14-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day14 ${BANAN_AOC2023_BIN}/day14
|
|
||||||
DEPENDS aoc2023_day14
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day14)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day14-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day15 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day15 ${SOURCES})
|
add_executable(aoc2023_day15 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day15 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day15 ban)
|
||||||
target_link_libraries(aoc2023_day15 PUBLIC libc ban)
|
banan_link_library(aoc2023_day15 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day15 libc-install ban-install)
|
install(TARGETS aoc2023_day15)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day15-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day15 ${BANAN_AOC2023_BIN}/day15
|
|
||||||
DEPENDS aoc2023_day15
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day15)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day15-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day16 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day16 ${SOURCES})
|
add_executable(aoc2023_day16 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day16 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day16 ban)
|
||||||
target_link_libraries(aoc2023_day16 PUBLIC libc ban)
|
banan_link_library(aoc2023_day16 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day16 libc-install ban-install)
|
install(TARGETS aoc2023_day16)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day16-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day16 ${BANAN_AOC2023_BIN}/day16
|
|
||||||
DEPENDS aoc2023_day16
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day16)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day16-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day17 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day17 ${SOURCES})
|
add_executable(aoc2023_day17 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day17 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day17 ban)
|
||||||
target_link_libraries(aoc2023_day17 PUBLIC libc ban)
|
banan_link_library(aoc2023_day17 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day17 libc-install ban-install)
|
install(TARGETS aoc2023_day17)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day17-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day17 ${BANAN_AOC2023_BIN}/day17
|
|
||||||
DEPENDS aoc2023_day17
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day17)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day17-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day18 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day18 ${SOURCES})
|
add_executable(aoc2023_day18 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day18 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day18 ban)
|
||||||
target_link_libraries(aoc2023_day18 PUBLIC libc ban)
|
banan_link_library(aoc2023_day18 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day18 libc-install ban-install)
|
install(TARGETS aoc2023_day18)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day18-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day18 ${BANAN_AOC2023_BIN}/day18
|
|
||||||
DEPENDS aoc2023_day18
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day18)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day18-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day19 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day19 ${SOURCES})
|
add_executable(aoc2023_day19 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day19 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day19 ban)
|
||||||
target_link_libraries(aoc2023_day19 PUBLIC libc ban)
|
banan_link_library(aoc2023_day19 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day19 libc-install ban-install)
|
install(TARGETS aoc2023_day19)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day19-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day19 ${BANAN_AOC2023_BIN}/day19
|
|
||||||
DEPENDS aoc2023_day19
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day19)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day19-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day2 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day2 ${SOURCES})
|
add_executable(aoc2023_day2 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day2 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day2 ban)
|
||||||
target_link_libraries(aoc2023_day2 PUBLIC libc)
|
banan_link_library(aoc2023_day2 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day2 libc-install ban-install)
|
install(TARGETS aoc2023_day2)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day2-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day2 ${BANAN_AOC2023_BIN}/day2
|
|
||||||
DEPENDS aoc2023_day2
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day2)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day2-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day20 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day20 ${SOURCES})
|
add_executable(aoc2023_day20 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day20 PUBLIC -O2 -g)
|
banan_link_library(aoc2023_day20 ban)
|
||||||
target_link_libraries(aoc2023_day20 PUBLIC libc ban)
|
banan_link_library(aoc2023_day20 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day20 libc-install ban-install)
|
install(TARGETS aoc2023_day20)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day20-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day20 ${BANAN_AOC2023_BIN}/day20
|
|
||||||
DEPENDS aoc2023_day20
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day20)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day20-install)
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ struct Module
|
||||||
BAN::String name;
|
BAN::String name;
|
||||||
BAN::Vector<BAN::String> targets;
|
BAN::Vector<BAN::String> targets;
|
||||||
|
|
||||||
|
virtual ~Module() {}
|
||||||
|
|
||||||
virtual void handle_signal(const Signal& signal, BAN::Queue<Signal>& signal_queue) = 0;
|
virtual void handle_signal(const Signal& signal, BAN::Queue<Signal>& signal_queue) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day21 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day21 ${SOURCES})
|
add_executable(aoc2023_day21 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day21 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day21 ban)
|
||||||
target_link_libraries(aoc2023_day21 PUBLIC libc ban)
|
banan_link_library(aoc2023_day21 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day21 libc-install ban-install)
|
install(TARGETS aoc2023_day21)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day21-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day21 ${BANAN_AOC2023_BIN}/day21
|
|
||||||
DEPENDS aoc2023_day21
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day21)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day21-install)
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
set(SOURCES
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(aoc2023_day22 ${SOURCES})
|
||||||
|
banan_include_headers(aoc2023_day22 ban)
|
||||||
|
banan_link_library(aoc2023_day22 libc)
|
||||||
|
|
||||||
|
install(TARGETS aoc2023_day22)
|
|
@ -0,0 +1,191 @@
|
||||||
|
#include <BAN/HashSet.h>
|
||||||
|
#include <BAN/Sort.h>
|
||||||
|
#include <BAN/Vector.h>
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
using i8 = int8_t;
|
||||||
|
using i16 = int16_t;
|
||||||
|
using i32 = int32_t;
|
||||||
|
using i64 = int64_t;
|
||||||
|
|
||||||
|
using u8 = uint8_t;
|
||||||
|
using u16 = uint16_t;
|
||||||
|
using u32 = uint32_t;
|
||||||
|
using u64 = uint64_t;
|
||||||
|
|
||||||
|
struct Position
|
||||||
|
{
|
||||||
|
i64 x, y, z;
|
||||||
|
|
||||||
|
bool operator==(const Position& other) const
|
||||||
|
{
|
||||||
|
return x == other.x && y == other.y && z == other.z;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static constexpr bool rectangle_contains(const Position& c1, const Position& c2, const Position& p)
|
||||||
|
{
|
||||||
|
ASSERT(c1.x <= c2.x);
|
||||||
|
ASSERT(c1.y <= c2.y);
|
||||||
|
return (c1.x <= p.x && p.x <= c2.x) && (c1.y <= p.y && p.y <= c2.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Brick
|
||||||
|
{
|
||||||
|
Position corners[2];
|
||||||
|
BAN::HashSet<Brick*> supporting;
|
||||||
|
BAN::HashSet<Brick*> supported_by;
|
||||||
|
|
||||||
|
bool supports(const Brick& other) const
|
||||||
|
{
|
||||||
|
if (corners[1].z + 1 != other.corners[0].z)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (i32 i = 0; i < 4; i++)
|
||||||
|
if (rectangle_contains(corners[0], corners[1], { other.corners[i / 2].x, other.corners[i % 2].y, 0 }))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
for (i32 i = 0; i < 4; i++)
|
||||||
|
if (rectangle_contains(other.corners[0], other.corners[1], { corners[i / 2].x, corners[i % 2].y, 0 }))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
i64 parse_i64(BAN::StringView str)
|
||||||
|
{
|
||||||
|
i64 result = 0;
|
||||||
|
for (char c : str)
|
||||||
|
{
|
||||||
|
ASSERT(isdigit(c));
|
||||||
|
result = (result * 10) + (c - '0');
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
BAN::Vector<Brick> parse_bricks(FILE* fp)
|
||||||
|
{
|
||||||
|
BAN::Vector<Brick> bricks;
|
||||||
|
|
||||||
|
char buffer[64];
|
||||||
|
while (fgets(buffer, sizeof(buffer), fp))
|
||||||
|
{
|
||||||
|
BAN::StringView line(buffer);
|
||||||
|
ASSERT(line.back() == '\n');
|
||||||
|
line = line.substring(0, line.size() - 1);
|
||||||
|
if (line.empty())
|
||||||
|
break;
|
||||||
|
|
||||||
|
auto corner_strs = MUST(line.split('~'));
|
||||||
|
ASSERT(corner_strs.size() == 2);
|
||||||
|
|
||||||
|
Brick brick;
|
||||||
|
for (i32 i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
auto coords = MUST(corner_strs[i].split(','));
|
||||||
|
ASSERT(coords.size() == 3);
|
||||||
|
brick.corners[i].x = parse_i64(coords[0]);
|
||||||
|
brick.corners[i].y = parse_i64(coords[1]);
|
||||||
|
brick.corners[i].z = parse_i64(coords[2]);
|
||||||
|
}
|
||||||
|
ASSERT(brick.corners[0].x <= brick.corners[1].x);
|
||||||
|
ASSERT(brick.corners[0].y <= brick.corners[1].y);
|
||||||
|
ASSERT(brick.corners[0].z <= brick.corners[1].z);
|
||||||
|
MUST(bricks.push_back(brick));
|
||||||
|
}
|
||||||
|
|
||||||
|
return bricks;
|
||||||
|
}
|
||||||
|
|
||||||
|
i64 puzzle1(FILE* fp)
|
||||||
|
{
|
||||||
|
auto brick_comp = [](const Brick& b1, const Brick& b2) { return b1.corners[0].z < b2.corners[0].z; };
|
||||||
|
|
||||||
|
auto bricks = parse_bricks(fp);
|
||||||
|
BAN::sort::sort(bricks.begin(), bricks.end(), brick_comp);
|
||||||
|
|
||||||
|
// Simulate brick falling
|
||||||
|
for (size_t i = 0; i < bricks.size();)
|
||||||
|
{
|
||||||
|
bool can_fall = bricks[i].corners[0].z > 1;
|
||||||
|
for (size_t j = 0; j < i && can_fall; j++)
|
||||||
|
if (bricks[j].supports(bricks[i]))
|
||||||
|
can_fall = false;
|
||||||
|
|
||||||
|
if (!can_fall)
|
||||||
|
i++;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bricks[i].corners[0].z--;
|
||||||
|
bricks[i].corners[1].z--;
|
||||||
|
for (; i > 0; i--)
|
||||||
|
{
|
||||||
|
if (brick_comp(bricks[i - 1], bricks[i]))
|
||||||
|
break;
|
||||||
|
BAN::swap(bricks[i - 1], bricks[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store brick supporting structures
|
||||||
|
for (size_t i = 0; i < bricks.size(); i++)
|
||||||
|
{
|
||||||
|
for (size_t j = 0; j < bricks.size(); j++)
|
||||||
|
{
|
||||||
|
if (i == j)
|
||||||
|
continue;
|
||||||
|
if (bricks[i].supports(bricks[j]))
|
||||||
|
{
|
||||||
|
MUST(bricks[i].supporting.insert(&bricks[j]));
|
||||||
|
MUST(bricks[j].supported_by.insert(&bricks[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i64 result = 0;
|
||||||
|
for (const auto& brick : bricks)
|
||||||
|
{
|
||||||
|
bool disintegratable = true;
|
||||||
|
for (const auto* support : brick.supporting)
|
||||||
|
if (support->supported_by.size() <= 1)
|
||||||
|
disintegratable = false;
|
||||||
|
result += disintegratable;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFF BY 7
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
i64 puzzle2(FILE* fp)
|
||||||
|
{
|
||||||
|
(void)fp;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
const char* file_path = "/usr/share/aoc2023/day22_input.txt";
|
||||||
|
|
||||||
|
if (argc >= 2)
|
||||||
|
file_path = argv[1];
|
||||||
|
|
||||||
|
FILE* fp = fopen(file_path, "r");
|
||||||
|
if (fp == nullptr)
|
||||||
|
{
|
||||||
|
perror("fopen");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("puzzle1: %" PRId64 "\n", puzzle1(fp));
|
||||||
|
|
||||||
|
fseek(fp, 0, SEEK_SET);
|
||||||
|
|
||||||
|
printf("puzzle2: %" PRId64 "\n", puzzle2(fp));
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
}
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day23 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day23 ${SOURCES})
|
add_executable(aoc2023_day23 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day23 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day23 ban)
|
||||||
target_link_libraries(aoc2023_day23 PUBLIC libc ban)
|
banan_link_library(aoc2023_day23 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day23 libc-install ban-install)
|
install(TARGETS aoc2023_day23)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day23-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day23 ${BANAN_AOC2023_BIN}/day23
|
|
||||||
DEPENDS aoc2023_day23
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day23)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day23-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day24 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day24 ${SOURCES})
|
add_executable(aoc2023_day24 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day24 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day24 ban)
|
||||||
target_link_libraries(aoc2023_day24 PUBLIC libc ban)
|
banan_link_library(aoc2023_day24 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day24 libc-install ban-install)
|
install(TARGETS aoc2023_day24)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day24-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day24 ${BANAN_AOC2023_BIN}/day24
|
|
||||||
DEPENDS aoc2023_day24
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day24)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day24-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day25 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day25 ${SOURCES})
|
add_executable(aoc2023_day25 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day25 PUBLIC -O2 -g)
|
banan_link_library(aoc2023_day25 ban)
|
||||||
target_link_libraries(aoc2023_day25 PUBLIC libc ban)
|
banan_link_library(aoc2023_day25 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day25 libc-install ban-install)
|
install(TARGETS aoc2023_day25)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day25-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day25 ${BANAN_AOC2023_BIN}/day25
|
|
||||||
DEPENDS aoc2023_day25
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day25)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day25-install)
|
|
||||||
|
|
|
@ -21,6 +21,9 @@ using u64 = uint64_t;
|
||||||
|
|
||||||
struct Component
|
struct Component
|
||||||
{
|
{
|
||||||
|
Component(BAN::String name)
|
||||||
|
: name(BAN::move(name))
|
||||||
|
{}
|
||||||
BAN::String name;
|
BAN::String name;
|
||||||
BAN::Vector<BAN::String> connections;
|
BAN::Vector<BAN::String> connections;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day3 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day3 ${SOURCES})
|
add_executable(aoc2023_day3 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day3 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day3 ban)
|
||||||
target_link_libraries(aoc2023_day3 PUBLIC libc ban)
|
banan_link_library(aoc2023_day3 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day3 libc-install ban-install)
|
install(TARGETS aoc2023_day3)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day3-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day3 ${BANAN_AOC2023_BIN}/day3
|
|
||||||
DEPENDS aoc2023_day3
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day3)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day3-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day4 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day4 ${SOURCES})
|
add_executable(aoc2023_day4 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day4 PUBLIC -O2 -g)
|
banan_link_library(aoc2023_day4 ban)
|
||||||
target_link_libraries(aoc2023_day4 PUBLIC libc ban)
|
banan_link_library(aoc2023_day4 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day4 libc-install ban-install)
|
install(TARGETS aoc2023_day4)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day4-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day4 ${BANAN_AOC2023_BIN}/day4
|
|
||||||
DEPENDS aoc2023_day4
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day4)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day4-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day5 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day5 ${SOURCES})
|
add_executable(aoc2023_day5 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day5 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day5 ban)
|
||||||
target_link_libraries(aoc2023_day5 PUBLIC libc ban)
|
banan_link_library(aoc2023_day5 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day5 libc-install ban-install)
|
install(TARGETS aoc2023_day5)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day5-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day5 ${BANAN_AOC2023_BIN}/day5
|
|
||||||
DEPENDS aoc2023_day5
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day5)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day5-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day6 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day6 ${SOURCES})
|
add_executable(aoc2023_day6 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day6 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day6 ban)
|
||||||
target_link_libraries(aoc2023_day6 PUBLIC libc ban)
|
banan_link_library(aoc2023_day6 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day6 libc-install ban-install)
|
install(TARGETS aoc2023_day6)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day6-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day6 ${BANAN_AOC2023_BIN}/day6
|
|
||||||
DEPENDS aoc2023_day6
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day6)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day6-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day7 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day7 ${SOURCES})
|
add_executable(aoc2023_day7 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day7 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day7 ban)
|
||||||
target_link_libraries(aoc2023_day7 PUBLIC libc ban)
|
banan_link_library(aoc2023_day7 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day7 libc-install ban-install)
|
install(TARGETS aoc2023_day7)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day7-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day7 ${BANAN_AOC2023_BIN}/day7
|
|
||||||
DEPENDS aoc2023_day7
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day7)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day7-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day8 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day8 ${SOURCES})
|
add_executable(aoc2023_day8 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day8 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day8 ban)
|
||||||
target_link_libraries(aoc2023_day8 PUBLIC libc ban)
|
banan_link_library(aoc2023_day8 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day8 libc-install ban-install)
|
install(TARGETS aoc2023_day8)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day8-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day8 ${BANAN_AOC2023_BIN}/day8
|
|
||||||
DEPENDS aoc2023_day8
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day8)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day8-install)
|
|
||||||
|
|
|
@ -1,22 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023_day9 CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023_day9 ${SOURCES})
|
add_executable(aoc2023_day9 ${SOURCES})
|
||||||
target_compile_options(aoc2023_day9 PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_day9 ban)
|
||||||
target_link_libraries(aoc2023_day9 PUBLIC libc ban)
|
banan_link_library(aoc2023_day9 libc)
|
||||||
|
|
||||||
add_dependencies(aoc2023_day9 libc-install ban-install)
|
install(TARGETS aoc2023_day9)
|
||||||
|
|
||||||
add_custom_target(aoc2023_day9-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023_day9 ${BANAN_AOC2023_BIN}/day9
|
|
||||||
DEPENDS aoc2023_day9
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023_day9)
|
|
||||||
add_dependencies(aoc2023-install aoc2023_day9-install)
|
|
||||||
|
|
|
@ -1,20 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(aoc2023-full CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(aoc2023-full ${SOURCES})
|
add_executable(aoc2023_full ${SOURCES})
|
||||||
target_compile_options(aoc2023-full PUBLIC -O2 -g)
|
banan_include_headers(aoc2023_full ban)
|
||||||
target_link_libraries(aoc2023-full PUBLIC libc)
|
banan_link_library(aoc2023_full libc)
|
||||||
|
|
||||||
add_custom_target(aoc2023-full-install
|
install(TARGETS aoc2023_full)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023-full ${BANAN_AOC2023_BIN}/full
|
|
||||||
DEPENDS aoc2023-full
|
|
||||||
DEPENDS aoc2023_always
|
|
||||||
)
|
|
||||||
|
|
||||||
add_dependencies(aoc2023 aoc2023-full)
|
|
||||||
add_dependencies(aoc2023-install aoc2023-full-install)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(cat-mmap CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(cat-mmap ${SOURCES})
|
add_executable(cat-mmap ${SOURCES})
|
||||||
target_compile_options(cat-mmap PUBLIC -O2 -g)
|
banan_link_library(cat-mmap libc)
|
||||||
target_link_libraries(cat-mmap PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(cat-mmap-install
|
install(TARGETS cat-mmap)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/cat-mmap ${BANAN_BIN}/
|
|
||||||
DEPENDS cat-mmap
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(cat CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(cat ${SOURCES})
|
add_executable(cat ${SOURCES})
|
||||||
target_compile_options(cat PUBLIC -O2 -g)
|
banan_link_library(cat libc)
|
||||||
target_link_libraries(cat PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(cat-install
|
install(TARGETS cat)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/cat ${BANAN_BIN}/
|
|
||||||
DEPENDS cat
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(chmod CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(chmod ${SOURCES})
|
add_executable(chmod ${SOURCES})
|
||||||
target_compile_options(chmod PUBLIC -O2 -g)
|
banan_link_library(chmod libc)
|
||||||
target_link_libraries(chmod PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(chmod-install
|
install(TARGETS chmod)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/chmod ${BANAN_BIN}/
|
|
||||||
DEPENDS chmod
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(cp CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(cp ${SOURCES})
|
add_executable(cp ${SOURCES})
|
||||||
target_compile_options(cp PUBLIC -O2 -g)
|
banan_include_headers(cp ban)
|
||||||
target_link_libraries(cp PUBLIC libc ban)
|
banan_link_library(cp libc)
|
||||||
|
|
||||||
add_custom_target(cp-install
|
install(TARGETS cp)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/cp ${BANAN_BIN}/
|
|
||||||
DEPENDS cp
|
|
||||||
)
|
|
||||||
|
|
|
@ -7,27 +7,22 @@ PROGRAM_NAME=$1
|
||||||
mkdir $PROGRAM_NAME
|
mkdir $PROGRAM_NAME
|
||||||
|
|
||||||
cat > $PROGRAM_NAME/CMakeLists.txt << EOF
|
cat > $PROGRAM_NAME/CMakeLists.txt << EOF
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project($PROGRAM_NAME CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable($PROGRAM_NAME \${SOURCES})
|
add_executable($PROGRAM_NAME \${SOURCES})
|
||||||
target_compile_options($PROGRAM_NAME PUBLIC -O2 -g)
|
banan_link_library($PROGRAM_NAME ban)
|
||||||
target_link_libraries($PROGRAM_NAME PUBLIC libc)
|
banan_link_library($PROGRAM_NAME libc)
|
||||||
|
|
||||||
add_custom_target($PROGRAM_NAME-install
|
install(TARGETS $PROGRAM_NAME)
|
||||||
COMMAND \${CMAKE_COMMAND} -E copy \${CMAKE_CURRENT_BINARY_DIR}/$PROGRAM_NAME \${BANAN_BIN}/
|
|
||||||
DEPENDS $PROGRAM_NAME
|
|
||||||
)
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $PROGRAM_NAME/main.cpp << EOF
|
cat > $PROGRAM_NAME/main.cpp << EOF
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
printf("Hello World\n");
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(dd CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(dd ${SOURCES})
|
add_executable(dd ${SOURCES})
|
||||||
target_compile_options(dd PUBLIC -O2 -g)
|
banan_link_library(dd libc)
|
||||||
target_link_libraries(dd PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(dd-install
|
install(TARGETS dd)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/dd ${BANAN_BIN}/
|
|
||||||
DEPENDS dd
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(dhcp-client CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(dhcp-client ${SOURCES})
|
add_executable(dhcp-client ${SOURCES})
|
||||||
target_compile_options(dhcp-client PUBLIC -O2 -g)
|
banan_include_headers(dhcp-client ban)
|
||||||
target_link_libraries(dhcp-client PUBLIC libc)
|
banan_link_library(dhcp-client libc)
|
||||||
|
|
||||||
add_custom_target(dhcp-client-install
|
install(TARGETS dhcp-client)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/dhcp-client ${BANAN_BIN}/
|
|
||||||
DEPENDS dhcp-client
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(echo CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(echo ${SOURCES})
|
add_executable(echo ${SOURCES})
|
||||||
target_compile_options(echo PUBLIC -O2 -g)
|
banan_link_library(echo libc)
|
||||||
target_link_libraries(echo PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(echo-install
|
install(TARGETS echo)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/echo ${BANAN_BIN}/
|
|
||||||
DEPENDS echo
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(getopt CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(getopt ${SOURCES})
|
add_executable(getopt ${SOURCES})
|
||||||
target_compile_options(getopt PUBLIC -O2 -g)
|
banan_include_headers(getopt ban)
|
||||||
target_link_libraries(getopt PUBLIC libc ban)
|
banan_link_library(getopt libc)
|
||||||
|
|
||||||
add_custom_target(getopt-install
|
install(TARGETS getopt)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/getopt ${BANAN_BIN}/
|
|
||||||
DEPENDS getopt
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(id CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(id ${SOURCES})
|
add_executable(id ${SOURCES})
|
||||||
target_compile_options(id PUBLIC -O2 -g)
|
banan_include_headers(id ban)
|
||||||
target_link_libraries(id PUBLIC libc ban)
|
banan_link_library(id libc)
|
||||||
|
|
||||||
add_custom_target(id-install
|
install(TARGETS id)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/id ${BANAN_BIN}/
|
|
||||||
DEPENDS id
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(image CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(image ${SOURCES})
|
add_executable(image ${SOURCES})
|
||||||
target_compile_options(image PUBLIC -O2 -g)
|
banan_include_headers(image ban)
|
||||||
target_link_libraries(image PUBLIC libc ban libimage)
|
banan_link_library(image libc)
|
||||||
|
banan_link_library(image libimage)
|
||||||
|
|
||||||
add_custom_target(image-install
|
install(TARGETS image)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/image ${BANAN_BIN}/
|
|
||||||
DEPENDS image
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(init CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(init ${SOURCES})
|
add_executable(init ${SOURCES})
|
||||||
target_compile_options(init PUBLIC -O2 -g)
|
banan_include_headers(init ban)
|
||||||
target_link_libraries(init PUBLIC libc ban)
|
banan_link_library(init libc)
|
||||||
|
|
||||||
add_custom_target(init-install
|
install(TARGETS init)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/init ${BANAN_BIN}/
|
|
||||||
DEPENDS init
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(libraries CXX)
|
|
||||||
|
|
||||||
set(USERSPACE_LIBRARIES
|
set(USERSPACE_LIBRARIES
|
||||||
LibC
|
LibC
|
||||||
LibELF
|
LibELF
|
||||||
|
@ -11,23 +7,17 @@ set(USERSPACE_LIBRARIES
|
||||||
LibInput
|
LibInput
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(LIBRARY ${USERSPACE_LIBRARIES})
|
foreach(library ${USERSPACE_LIBRARIES})
|
||||||
add_subdirectory(${LIBRARY})
|
add_subdirectory(${library})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(libraries)
|
add_custom_target(libraries)
|
||||||
add_custom_target(libraries-headers)
|
|
||||||
add_custom_target(libraries-install)
|
|
||||||
|
|
||||||
foreach(LIBRARY ${USERSPACE_LIBRARIES})
|
foreach(library ${USERSPACE_LIBRARIES})
|
||||||
string(TOLOWER ${LIBRARY} LIBRARY_LOWER)
|
string(TOLOWER ${library} library_lower)
|
||||||
|
if (TARGET ${library_lower})
|
||||||
if (TARGET ${LIBRARY_LOWER})
|
add_dependencies(libraries ${library_lower})
|
||||||
add_dependencies(libraries ${LIBRARY_LOWER})
|
|
||||||
# This is to allow cmake to link when libc updates
|
# This is to allow cmake to link when libc updates
|
||||||
target_link_options(${LIBRARY_LOWER} PRIVATE -nolibc)
|
target_link_options(${library_lower} PRIVATE -nolibc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_dependencies(libraries-headers ${LIBRARY_LOWER}-headers)
|
|
||||||
add_dependencies(libraries-install ${LIBRARY_LOWER}-install)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(libc CXX ASM)
|
|
||||||
|
|
||||||
set(LIBC_SOURCES
|
set(LIBC_SOURCES
|
||||||
arpa/inet.cpp
|
arpa/inet.cpp
|
||||||
assert.cpp
|
assert.cpp
|
||||||
|
@ -35,34 +31,24 @@ set(LIBC_SOURCES
|
||||||
../../../BAN/BAN/Assert.cpp
|
../../../BAN/BAN/Assert.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(libc-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(crtx
|
|
||||||
COMMAND ${CMAKE_C_COMPILER} -c ${CMAKE_CURRENT_SOURCE_DIR}/arch/${BANAN_ARCH}/crt0.S -o crt0.o
|
|
||||||
COMMAND ${CMAKE_C_COMPILER} -c ${CMAKE_CURRENT_SOURCE_DIR}/arch/${BANAN_ARCH}/crti.S -o crti.o
|
|
||||||
COMMAND ${CMAKE_C_COMPILER} -c ${CMAKE_CURRENT_SOURCE_DIR}/arch/${BANAN_ARCH}/crtn.S -o crtn.o
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(crtx-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy crt0.o ${BANAN_LIB}/
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy crti.o ${BANAN_LIB}/
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy crtn.o ${BANAN_LIB}/
|
|
||||||
DEPENDS crtx
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(libc ${LIBC_SOURCES})
|
add_library(libc ${LIBC_SOURCES})
|
||||||
add_dependencies(libc headers crtx-install)
|
|
||||||
|
|
||||||
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)
|
||||||
target_compile_options(libc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=)
|
target_compile_options(libc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=)
|
||||||
|
|
||||||
add_custom_target(libc-install
|
add_library(crt0 OBJECT arch/${BANAN_ARCH}/crt0.S)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libc.a ${BANAN_LIB}/
|
add_library(crti OBJECT arch/${BANAN_ARCH}/crti.S)
|
||||||
DEPENDS libc
|
add_library(crtn OBJECT arch/${BANAN_ARCH}/crtn.S)
|
||||||
BYPRODUCTS ${BANAN_LIB}/libc.a
|
add_custom_target(crtx-install
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_OBJECTS:crt0> ${CMAKE_INSTALL_LIBDIR}/crt0.o
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_OBJECTS:crti> ${CMAKE_INSTALL_LIBDIR}/crti.o
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_OBJECTS:crtn> ${CMAKE_INSTALL_LIBDIR}/crtn.o
|
||||||
|
DEPENDS crt0 crti crtn sysroot
|
||||||
)
|
)
|
||||||
|
|
||||||
|
banan_include_headers(libc ban)
|
||||||
|
banan_include_headers(libc kernel)
|
||||||
|
|
||||||
|
banan_install_headers(libc)
|
||||||
|
install(TARGETS libc)
|
||||||
|
|
||||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
set(SOURCES
|
||||||
|
dummy.cpp
|
||||||
project(LibELF CXX)
|
|
||||||
|
|
||||||
add_custom_target(libelf-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(libelf-install
|
add_library(libelf ${SOURCES})
|
||||||
DEPENDS libelf-headers
|
|
||||||
)
|
banan_install_headers(libelf)
|
||||||
|
install(TARGETS libelf)
|
||||||
|
|
|
@ -1,25 +1,13 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(libfont CXX)
|
|
||||||
|
|
||||||
set(LIBGUI_SOURCES
|
set(LIBGUI_SOURCES
|
||||||
Font.cpp
|
Font.cpp
|
||||||
PSF.cpp
|
PSF.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(libfont-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(libfont ${LIBGUI_SOURCES})
|
add_library(libfont ${LIBGUI_SOURCES})
|
||||||
add_dependencies(libfont headers libc-install)
|
banan_link_library(libfont libc)
|
||||||
target_link_libraries(libfont PUBLIC libc)
|
banan_link_library(libfont ban)
|
||||||
|
|
||||||
add_custom_target(libfont-install
|
banan_install_headers(libfont)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libfont.a ${BANAN_LIB}/
|
install(TARGETS libfont)
|
||||||
DEPENDS libfont
|
|
||||||
BYPRODUCTS ${BANAN_LIB}/libfont.a
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||||
|
|
|
@ -1,24 +1,14 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(libgui CXX)
|
|
||||||
|
|
||||||
set(LIBGUI_SOURCES
|
set(LIBGUI_SOURCES
|
||||||
Window.cpp
|
Window.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(libgui-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(libgui ${LIBGUI_SOURCES})
|
add_library(libgui ${LIBGUI_SOURCES})
|
||||||
add_dependencies(libgui headers libc-install)
|
banan_include_headers(libgui ban)
|
||||||
target_link_libraries(libgui PUBLIC libc libfont)
|
banan_include_headers(libgui libfont)
|
||||||
|
banan_include_headers(libgui libinput)
|
||||||
|
banan_link_library(libgui libc)
|
||||||
|
|
||||||
add_custom_target(libgui-install
|
banan_install_headers(libgui)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libgui.a ${BANAN_LIB}/
|
install(TARGETS libgui)
|
||||||
DEPENDS libgui
|
|
||||||
BYPRODUCTS ${BANAN_LIB}/libgui.a
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||||
|
|
|
@ -1,27 +1,15 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(libimage CXX)
|
|
||||||
|
|
||||||
set(LIBIMAGE_SOURCES
|
set(LIBIMAGE_SOURCES
|
||||||
Image.cpp
|
Image.cpp
|
||||||
Netbpm.cpp
|
Netbpm.cpp
|
||||||
PNG.cpp
|
PNG.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(libimage-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(libimage ${LIBIMAGE_SOURCES})
|
add_library(libimage ${LIBIMAGE_SOURCES})
|
||||||
add_dependencies(libimage headers libc-install)
|
|
||||||
target_link_libraries(libimage PUBLIC libc)
|
|
||||||
target_compile_options(libimage PRIVATE -O3)
|
target_compile_options(libimage PRIVATE -O3)
|
||||||
|
banan_link_library(libimage libc)
|
||||||
|
banan_link_library(libimage ban)
|
||||||
|
|
||||||
add_custom_target(libimage-install
|
banan_install_headers(libimage)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libimage.a ${BANAN_LIB}/
|
install(TARGETS libimage)
|
||||||
DEPENDS libimage
|
|
||||||
BYPRODUCTS ${BANAN_LIB}/libimage.a
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||||
|
|
|
@ -1,24 +1,13 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(libinput CXX)
|
|
||||||
|
|
||||||
set(LIBINPUT_SOURCES
|
set(LIBINPUT_SOURCES
|
||||||
KeyEvent.cpp
|
KeyEvent.cpp
|
||||||
KeyboardLayout.cpp
|
KeyboardLayout.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(libinput-headers
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
||||||
DEPENDS sysroot
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(libinput ${LIBINPUT_SOURCES})
|
add_library(libinput ${LIBINPUT_SOURCES})
|
||||||
target_link_libraries(libinput PUBLIC libc ban)
|
banan_include_headers(libinput ban)
|
||||||
|
banan_link_library(libinput libc)
|
||||||
|
|
||||||
add_custom_target(libinput-install
|
banan_install_headers(libinput)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libinput.a ${BANAN_LIB}/
|
install(TARGETS libinput)
|
||||||
DEPENDS libinput
|
|
||||||
BYPRODUCTS ${BANAN_LIB}/libinput.a
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(loadkeys CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(loadkeys ${SOURCES})
|
add_executable(loadkeys ${SOURCES})
|
||||||
target_compile_options(loadkeys PUBLIC -O2 -g)
|
banan_link_library(loadkeys libc)
|
||||||
target_link_libraries(loadkeys PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(loadkeys-install
|
install(TARGETS loadkeys)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/loadkeys ${BANAN_BIN}/
|
|
||||||
DEPENDS loadkeys
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(ls CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(ls ${SOURCES})
|
add_executable(ls ${SOURCES})
|
||||||
target_compile_options(ls PUBLIC -O2 -g)
|
banan_link_library(ls ban)
|
||||||
target_link_libraries(ls PUBLIC libc ban)
|
banan_link_library(ls libc)
|
||||||
|
|
||||||
add_custom_target(ls-install
|
install(TARGETS ls)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/ls ${BANAN_BIN}/
|
|
||||||
DEPENDS ls
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(meminfo CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(meminfo ${SOURCES})
|
add_executable(meminfo ${SOURCES})
|
||||||
target_compile_options(meminfo PUBLIC -O2 -g)
|
banan_link_library(meminfo libc)
|
||||||
target_link_libraries(meminfo PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(meminfo-install
|
install(TARGETS meminfo)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/meminfo ${BANAN_BIN}/
|
|
||||||
DEPENDS meminfo
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(mkdir CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(mkdir ${SOURCES})
|
add_executable(mkdir ${SOURCES})
|
||||||
target_compile_options(mkdir PUBLIC -O2 -g)
|
banan_link_library(mkdir libc)
|
||||||
target_link_libraries(mkdir PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(mkdir-install
|
install(TARGETS mkdir)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/mkdir ${BANAN_BIN}/
|
|
||||||
DEPENDS mkdir
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(mmap-shared-test CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
|
||||||
main.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(mmap-shared-test ${SOURCES})
|
|
||||||
target_compile_options(mmap-shared-test PUBLIC -O2 -g)
|
|
||||||
target_link_libraries(mmap-shared-test PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(mmap-shared-test-install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/mmap-shared-test ${BANAN_BIN}/
|
|
||||||
DEPENDS mmap-shared-test
|
|
||||||
)
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(nslookup CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(nslookup ${SOURCES})
|
add_executable(nslookup ${SOURCES})
|
||||||
target_compile_options(nslookup PUBLIC -O2 -g)
|
banan_link_library(nslookup libc)
|
||||||
target_link_libraries(nslookup PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(nslookup-install
|
install(TARGETS nslookup)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/nslookup ${BANAN_BIN}/
|
|
||||||
DEPENDS nslookup
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(poweroff CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(poweroff ${SOURCES})
|
add_executable(poweroff ${SOURCES})
|
||||||
target_compile_options(poweroff PUBLIC -O2 -g)
|
banan_link_library(poweroff libc)
|
||||||
target_link_libraries(poweroff PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(poweroff-install
|
install(TARGETS poweroff)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/poweroff ${BANAN_BIN}/
|
|
||||||
DEPENDS poweroff
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(resolver CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(resolver ${SOURCES})
|
add_executable(resolver ${SOURCES})
|
||||||
target_compile_options(resolver PUBLIC -O2 -g)
|
banan_link_library(resolver ban)
|
||||||
target_link_libraries(resolver PUBLIC libc ban)
|
banan_link_library(resolver libc)
|
||||||
|
|
||||||
add_custom_target(resolver-install
|
install(TARGETS resolver)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/resolver ${BANAN_BIN}/
|
|
||||||
DEPENDS resolver
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(rm CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(rm ${SOURCES})
|
add_executable(rm ${SOURCES})
|
||||||
target_compile_options(rm PUBLIC -O2 -g)
|
banan_include_headers(rm ban)
|
||||||
target_link_libraries(rm PUBLIC libc ban)
|
banan_link_library(rm libc)
|
||||||
|
|
||||||
add_custom_target(rm-install
|
install(TARGETS rm)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/rm ${BANAN_BIN}/
|
|
||||||
DEPENDS rm
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(sleep CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(sleep ${SOURCES})
|
add_executable(sleep ${SOURCES})
|
||||||
target_compile_options(sleep PUBLIC -O2 -g)
|
banan_link_library(sleep libc)
|
||||||
target_link_libraries(sleep PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(sleep-install
|
install(TARGETS sleep)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/sleep ${BANAN_BIN}/
|
|
||||||
DEPENDS sleep
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(snake CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(snake ${SOURCES})
|
add_executable(snake ${SOURCES})
|
||||||
target_compile_options(snake PUBLIC -O2 -g)
|
banan_include_headers(snake ban)
|
||||||
target_link_libraries(snake PUBLIC libc)
|
banan_link_library(snake libc)
|
||||||
|
|
||||||
add_custom_target(snake-install
|
install(TARGETS snake)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/snake ${BANAN_BIN}/
|
|
||||||
DEPENDS snake
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(stat CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(stat ${SOURCES})
|
add_executable(stat ${SOURCES})
|
||||||
target_compile_options(stat PUBLIC -O2 -g)
|
banan_link_library(stat ban)
|
||||||
target_link_libraries(stat PUBLIC libc ban)
|
banan_link_library(stat libc)
|
||||||
|
|
||||||
add_custom_target(stat-install
|
install(TARGETS stat)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/stat ${BANAN_BIN}/
|
|
||||||
DEPENDS stat
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(sudo CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(sudo ${SOURCES})
|
add_executable(sudo ${SOURCES})
|
||||||
target_compile_options(sudo PUBLIC -O2 -g)
|
banan_link_library(sudo libc)
|
||||||
target_link_libraries(sudo PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(sudo-install
|
install(TARGETS sudo)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/sudo ${BANAN_BIN}/
|
|
||||||
COMMAND /bin/chmod u+s ${BANAN_BIN}/sudo
|
|
||||||
DEPENDS sudo
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(sync CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(sync ${SOURCES})
|
add_executable(sync ${SOURCES})
|
||||||
target_compile_options(sync PUBLIC -O2 -g)
|
banan_link_library(sync libc)
|
||||||
target_link_libraries(sync PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(sync-install
|
install(TARGETS sync)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/sync ${BANAN_BIN}/
|
|
||||||
DEPENDS sync
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(tee CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(tee ${SOURCES})
|
add_executable(tee ${SOURCES})
|
||||||
target_compile_options(tee PUBLIC -O2 -g)
|
banan_link_library(tee libc)
|
||||||
target_link_libraries(tee PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(tee-install
|
install(TARGETS tee)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/tee ${BANAN_BIN}/
|
|
||||||
DEPENDS tee
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-framebuffer CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-framebuffer ${SOURCES})
|
add_executable(test-framebuffer ${SOURCES})
|
||||||
target_compile_options(test-framebuffer PUBLIC -O2 -g)
|
banan_link_library(test-framebuffer libc)
|
||||||
target_link_libraries(test-framebuffer PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(test-framebuffer-install
|
install(TARGETS test-framebuffer)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-framebuffer ${BANAN_BIN}/
|
|
||||||
DEPENDS test-framebuffer
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-globals CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-globals ${SOURCES})
|
add_executable(test-globals ${SOURCES})
|
||||||
target_compile_options(test-globals PUBLIC -O2 -g)
|
banan_link_library(test-globals libc)
|
||||||
target_link_libraries(test-globals PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(test-globals-install
|
install(TARGETS test-globals)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-globals ${BANAN_BIN}/
|
|
||||||
DEPENDS test-globals
|
|
||||||
)
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
set(SOURCES
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(test-mmap-shared ${SOURCES})
|
||||||
|
banan_link_library(test-mmap-shared libc)
|
||||||
|
|
||||||
|
install(TARGETS test-mmap-shared)
|
|
@ -1,16 +1,10 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-mouse CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-mouse ${SOURCES})
|
add_executable(test-mouse ${SOURCES})
|
||||||
target_compile_options(test-mouse PUBLIC -O2 -g)
|
banan_include_headers(test-mouse ban)
|
||||||
target_link_libraries(test-mouse PUBLIC libc)
|
banan_include_headers(test-mouse libinput)
|
||||||
|
banan_link_library(test-mouse libc)
|
||||||
|
|
||||||
add_custom_target(test-mouse-install
|
install(TARGETS test-mouse)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-mouse ${BANAN_BIN}/
|
|
||||||
DEPENDS test-mouse
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-popen CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-popen ${SOURCES})
|
add_executable(test-popen ${SOURCES})
|
||||||
target_compile_options(test-popen PUBLIC -O2 -g)
|
banan_link_library(test-popen libc)
|
||||||
target_link_libraries(test-popen PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(test-popen-install
|
install(TARGETS test-popen)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-popen ${BANAN_BIN}/
|
|
||||||
DEPENDS test-popen
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-sort CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-sort ${SOURCES})
|
add_executable(test-sort ${SOURCES})
|
||||||
target_compile_options(test-sort PUBLIC -O2 -g)
|
banan_include_headers(test-sort ban)
|
||||||
target_link_libraries(test-sort PUBLIC libc)
|
banan_link_library(test-sort libc)
|
||||||
|
|
||||||
add_custom_target(test-sort-install
|
install(TARGETS test-sort)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-sort ${BANAN_BIN}/
|
|
||||||
DEPENDS test-sort
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-tcp CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-tcp ${SOURCES})
|
add_executable(test-tcp ${SOURCES})
|
||||||
target_compile_options(test-tcp PUBLIC -O2 -g)
|
banan_link_library(test-tcp libc)
|
||||||
target_link_libraries(test-tcp PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(test-tcp-install
|
install(TARGETS test-tcp)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-tcp ${BANAN_BIN}/
|
|
||||||
DEPENDS test-tcp
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-udp CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-udp ${SOURCES})
|
add_executable(test-udp ${SOURCES})
|
||||||
target_compile_options(test-udp PUBLIC -O2 -g)
|
banan_link_library(test-udp libc)
|
||||||
target_link_libraries(test-udp PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(test-udp-install
|
install(TARGETS test-udp)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-udp ${BANAN_BIN}/
|
|
||||||
DEPENDS test-udp
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-unix-socket CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-unix-socket ${SOURCES})
|
add_executable(test-unix-socket ${SOURCES})
|
||||||
target_compile_options(test-unix-socket PUBLIC -O2 -g)
|
banan_link_library(test-unix-socket libc)
|
||||||
target_link_libraries(test-unix-socket PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(test-unix-socket-install
|
install(TARGETS test-unix-socket)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-unix-socket ${BANAN_BIN}/
|
|
||||||
DEPENDS test-unix-socket
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test-window CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test-window ${SOURCES})
|
add_executable(test-window ${SOURCES})
|
||||||
target_compile_options(test-window PUBLIC -O2 -g)
|
banan_include_headers(test-window ban)
|
||||||
target_link_libraries(test-window PUBLIC libc ban libgui)
|
banan_include_headers(test-window libinput)
|
||||||
|
banan_link_library(test-window libc)
|
||||||
|
banan_link_library(test-window libgui)
|
||||||
|
|
||||||
add_custom_target(test-window-install
|
install(TARGETS test-window)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test-window ${BANAN_BIN}/
|
|
||||||
DEPENDS test-window
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(test CXX)
|
|
||||||
|
|
||||||
set(TEST_SOURCES
|
set(TEST_SOURCES
|
||||||
test.cpp
|
test.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(test ${TEST_SOURCES})
|
add_executable(test ${TEST_SOURCES})
|
||||||
target_compile_options(test PUBLIC -O2 -g)
|
banan_link_library(test libc)
|
||||||
target_link_libraries(test PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(test-install
|
install(TARGETS test)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/test ${BANAN_BIN}/
|
|
||||||
DEPENDS test
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(touch CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(touch ${SOURCES})
|
add_executable(touch ${SOURCES})
|
||||||
target_compile_options(touch PUBLIC -O2 -g)
|
banan_link_library(touch libc)
|
||||||
target_link_libraries(touch PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(touch-install
|
install(TARGETS touch)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/touch ${BANAN_BIN}/
|
|
||||||
DEPENDS touch
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(u8sum CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(u8sum ${SOURCES})
|
add_executable(u8sum ${SOURCES})
|
||||||
target_compile_options(u8sum PUBLIC -O2 -g)
|
banan_link_library(u8sum libc)
|
||||||
target_link_libraries(u8sum PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(u8sum-install
|
install(TARGETS u8sum)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/u8sum ${BANAN_BIN}/
|
|
||||||
DEPENDS u8sum
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(whoami CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(whoami ${SOURCES})
|
add_executable(whoami ${SOURCES})
|
||||||
target_compile_options(whoami PUBLIC -O2 -g)
|
banan_include_headers(whoami ban)
|
||||||
target_link_libraries(whoami PUBLIC libc ban)
|
banan_link_library(whoami libc)
|
||||||
|
|
||||||
add_custom_target(whoami-install
|
install(TARGETS whoami)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/whoami ${BANAN_BIN}/
|
|
||||||
DEPENDS whoami
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.26)
|
|
||||||
|
|
||||||
project(yes CXX)
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(yes ${SOURCES})
|
add_executable(yes ${SOURCES})
|
||||||
target_compile_options(yes PUBLIC -O2 -g)
|
banan_link_library(yes libc)
|
||||||
target_link_libraries(yes PUBLIC libc)
|
|
||||||
|
|
||||||
add_custom_target(yes-install
|
install(TARGETS yes)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/yes ${BANAN_BIN}/
|
|
||||||
DEPENDS yes
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in New Issue