2021-01-12 13:57:58 +03:00
|
|
|
file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp")
|
2021-06-15 16:16:32 +03:00
|
|
|
list(APPEND SPECIAL_TARGETS test install)
|
|
|
|
list(APPEND REQUIRED_TARGETS
|
2022-10-26 07:11:34 +03:00
|
|
|
arp base64 basename cat chmod chown clear comm cp cut date dd df diff dirname dmesg du echo env expr false
|
2023-08-12 20:37:27 +03:00
|
|
|
file find grep groups gunzip head host hostname id ifconfig kill killall ln logout ls mkdir mount mv network-settings nproc
|
2023-07-06 15:34:59 +03:00
|
|
|
patch pgrep pidof ping pkill pmap ps readlink realpath reboot rm rmdir sed route seq shutdown sleep sort stat stty su tail test
|
2022-11-08 03:58:46 +03:00
|
|
|
touch tr true umount uname uniq uptime w wc which whoami xargs yes
|
2021-06-15 16:16:32 +03:00
|
|
|
)
|
|
|
|
list(APPEND RECOMMENDED_TARGETS
|
2024-01-14 12:39:30 +03:00
|
|
|
aconv adjtime aplay abench asctl bt checksum chres cksum copy fortune gzip init install keymap lsirq lsof lspci lzcat man mkfs.fat mknod mktemp
|
2023-06-04 19:35:35 +03:00
|
|
|
nc netstat notify ntpquery open passwd pixelflut pls printf pro shot strings tar tt unzip wallpaper xzcat zip
|
2021-06-15 16:16:32 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# FIXME: Support specifying component dependencies for utilities (e.g. WebSocket for telws)
|
2021-01-12 13:57:58 +03:00
|
|
|
|
|
|
|
foreach(CMD_SRC ${CMD_SOURCES})
|
2024-02-26 16:45:28 +03:00
|
|
|
get_filename_component(CMD_NAME ${CMD_SRC} NAME_WLE)
|
2021-01-12 13:57:58 +03:00
|
|
|
if (CMD_NAME IN_LIST SPECIAL_TARGETS)
|
2021-06-15 16:16:32 +03:00
|
|
|
set(TARGET_NAME "${CMD_NAME}-bin")
|
|
|
|
else()
|
|
|
|
set(TARGET_NAME "${CMD_NAME}")
|
|
|
|
endif()
|
|
|
|
if(CMD_NAME IN_LIST REQUIRED_TARGETS)
|
|
|
|
serenity_component(
|
|
|
|
${CMD_NAME}
|
|
|
|
REQUIRED
|
|
|
|
TARGETS ${TARGET_NAME}
|
|
|
|
)
|
|
|
|
elseif(CMD_NAME IN_LIST RECOMMENDED_TARGETS)
|
|
|
|
serenity_component(
|
|
|
|
${CMD_NAME}
|
|
|
|
RECOMMENDED
|
|
|
|
TARGETS ${TARGET_NAME}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
serenity_component(
|
|
|
|
${CMD_NAME}
|
|
|
|
TARGETS ${TARGET_NAME}
|
|
|
|
)
|
|
|
|
endif()
|
2022-10-25 22:15:07 +03:00
|
|
|
|
|
|
|
add_executable(${TARGET_NAME} ${CMD_SRC})
|
|
|
|
target_link_libraries(${TARGET_NAME} PRIVATE LibCore LibMain)
|
|
|
|
serenity_set_implicit_links(${TARGET_NAME})
|
|
|
|
set_target_properties(${TARGET_NAME} PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
|
|
|
install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin OPTIONAL)
|
|
|
|
|
2021-06-15 16:16:32 +03:00
|
|
|
if (CMD_NAME IN_LIST SPECIAL_TARGETS)
|
2022-12-22 20:26:40 +03:00
|
|
|
install(CODE
|
|
|
|
"if (EXISTS ${CMAKE_INSTALL_PREFIX}/bin/${CMD_NAME}-bin)
|
|
|
|
file(RENAME ${CMAKE_INSTALL_PREFIX}/bin/${CMD_NAME}-bin ${CMAKE_INSTALL_PREFIX}/bin/${CMD_NAME})
|
|
|
|
endif()")
|
2021-01-12 13:57:58 +03:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2022-05-20 08:46:36 +03:00
|
|
|
if (ENABLE_JAKT)
|
2022-08-29 02:47:03 +03:00
|
|
|
add_jakt_executable(hello-jakt
|
|
|
|
MAIN_SOURCE hello-world.jakt
|
|
|
|
)
|
2022-10-21 22:43:56 +03:00
|
|
|
target_link_libraries(hello-jakt PRIVATE LibC)
|
2022-05-20 08:46:36 +03:00
|
|
|
set_target_properties(hello-jakt PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
|
|
|
install(TARGETS hello-jakt RUNTIME DESTINATION bin OPTIONAL)
|
|
|
|
serenity_component(
|
|
|
|
hello-jakt
|
|
|
|
RECOMMENDED
|
|
|
|
TARGETS hello-jakt
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-03-20 20:44:01 +03:00
|
|
|
install(CODE "file(CREATE_LINK grep ${CMAKE_INSTALL_PREFIX}/bin/egrep SYMBOLIC)")
|
2022-10-26 07:11:34 +03:00
|
|
|
install(CODE "file(CREATE_LINK grep ${CMAKE_INSTALL_PREFIX}/bin/fgrep SYMBOLIC)")
|
2022-03-20 20:44:01 +03:00
|
|
|
install(CODE "file(CREATE_LINK grep ${CMAKE_INSTALL_PREFIX}/bin/rgrep SYMBOLIC)")
|
2023-08-12 20:37:27 +03:00
|
|
|
install(CODE "file(CREATE_LINK gunzip ${CMAKE_INSTALL_PREFIX}/bin/zcat SYMBOLIC)")
|
2022-03-20 20:44:01 +03:00
|
|
|
|
2023-05-13 14:00:22 +03:00
|
|
|
target_link_libraries(abench PRIVATE LibAudio LibFileSystem)
|
2023-06-22 22:53:00 +03:00
|
|
|
target_link_libraries(aconv PRIVATE LibAudio LibFileSystem)
|
2023-05-13 14:00:52 +03:00
|
|
|
target_link_libraries(aplay PRIVATE LibAudio LibFileSystem LibIPC)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(asctl PRIVATE LibAudio LibIPC)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(bt PRIVATE LibSymbolication LibURL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(checksum PRIVATE LibCrypto)
|
|
|
|
target_link_libraries(chres PRIVATE LibGUI LibIPC)
|
|
|
|
target_link_libraries(cksum PRIVATE LibCrypto)
|
|
|
|
target_link_libraries(config PRIVATE LibConfig LibIPC)
|
|
|
|
target_link_libraries(copy PRIVATE LibGUI)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(comm PRIVATE LibFileSystem)
|
|
|
|
target_link_libraries(cp PRIVATE LibFileSystem)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(cpp-lexer PRIVATE LibCpp)
|
|
|
|
target_link_libraries(cpp-parser PRIVATE LibCpp)
|
|
|
|
target_link_libraries(cpp-preprocessor PRIVATE LibCpp)
|
|
|
|
target_link_libraries(diff PRIVATE LibDiff)
|
|
|
|
target_link_libraries(disasm PRIVATE LibX86)
|
2023-11-15 18:13:36 +03:00
|
|
|
target_link_libraries(drain PRIVATE LibFileSystem)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(expr PRIVATE LibRegex)
|
|
|
|
target_link_libraries(fdtdump PRIVATE LibDeviceTree)
|
2023-07-03 17:45:59 +03:00
|
|
|
target_link_libraries(file PRIVATE LibGfx LibIPC LibArchive LibCompress LibAudio)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(find PRIVATE LibFileSystem LibRegex LibURL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(functrace PRIVATE LibDebug LibX86)
|
2023-07-24 01:10:51 +03:00
|
|
|
target_link_libraries(glsl-compiler PRIVATE LibGLSL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(gml-format PRIVATE LibGUI)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(grep PRIVATE LibFileSystem LibRegex LibURL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(gunzip PRIVATE LibCompress)
|
|
|
|
target_link_libraries(gzip PRIVATE LibCompress)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(headless-browser PRIVATE LibCrypto LibFileSystem LibGemini LibGfx LibHTTP LibImageDecoderClient LibTLS LibWeb LibWebView LibWebSocket LibIPC LibJS LibDiff LibURL)
|
|
|
|
target_link_libraries(icc PRIVATE LibGfx LibVideo LibURL)
|
2023-03-12 03:33:17 +03:00
|
|
|
target_link_libraries(image PRIVATE LibGfx)
|
2023-01-14 04:30:09 +03:00
|
|
|
target_link_libraries(image2bin PRIVATE LibGfx)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(ini PRIVATE LibFileSystem)
|
2023-05-13 14:23:30 +03:00
|
|
|
target_link_libraries(install-bin PRIVATE LibFileSystem)
|
2023-02-19 02:46:27 +03:00
|
|
|
target_link_libraries(isobmff PRIVATE LibGfx)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(js PRIVATE LibCrypto LibJS LibLine LibLocale LibTextCodec)
|
2022-09-02 17:41:33 +03:00
|
|
|
link_with_locale_data(js)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(keymap PRIVATE LibKeyboard)
|
2022-11-08 03:58:46 +03:00
|
|
|
target_link_libraries(less PRIVATE LibLine)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(ls PRIVATE LibFileSystem LibURL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(lspci PRIVATE LibPCIDB)
|
|
|
|
target_link_libraries(lsusb PRIVATE LibUSBDB)
|
2023-03-05 16:30:23 +03:00
|
|
|
target_link_libraries(lzcat PRIVATE LibCompress)
|
2022-06-24 10:38:57 +03:00
|
|
|
target_link_libraries(man PRIVATE LibMarkdown LibManual)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(markdown-check PRIVATE LibFileSystem LibMarkdown LibManual LibURL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(matroska PRIVATE LibVideo)
|
|
|
|
target_link_libraries(md PRIVATE LibMarkdown)
|
2024-01-14 12:39:30 +03:00
|
|
|
target_link_libraries(mkfs.fat PRIVATE LibFileSystem)
|
2023-04-28 18:01:14 +03:00
|
|
|
target_link_libraries(mktemp PRIVATE LibFileSystem)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(mv PRIVATE LibFileSystem)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(notify PRIVATE LibGfx LibGUI)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(open PRIVATE LibDesktop LibFileSystem LibURL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(passwd PRIVATE LibCrypt)
|
|
|
|
target_link_libraries(paste PRIVATE LibGUI)
|
2023-07-06 15:34:59 +03:00
|
|
|
target_link_libraries(patch PRIVATE LibDiff LibFileSystem)
|
2023-07-11 20:25:36 +03:00
|
|
|
target_link_libraries(pdf PRIVATE LibGfx LibPDF)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(pgrep PRIVATE LibRegex)
|
2023-06-04 19:35:35 +03:00
|
|
|
target_link_libraries(pixelflut PRIVATE LibImageDecoderClient LibIPC LibGfx)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(pkill PRIVATE LibRegex)
|
|
|
|
target_link_libraries(pls PRIVATE LibCrypt)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(pro PRIVATE LibFileSystem LibProtocol LibHTTP LibURL)
|
2023-05-13 00:31:49 +03:00
|
|
|
target_link_libraries(readlink PRIVATE LibFileSystem)
|
2023-06-20 13:59:03 +03:00
|
|
|
target_link_libraries(realpath PRIVATE LibFileSystem)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(run-tests PRIVATE LibCoredump LibDebug LibFileSystem LibRegex)
|
|
|
|
target_link_libraries(rm PRIVATE LibFileSystem)
|
2023-04-28 23:29:55 +03:00
|
|
|
target_link_libraries(sed PRIVATE LibRegex LibFileSystem)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(shot PRIVATE LibFileSystem LibGfx LibGUI LibIPC LibURL)
|
2023-10-05 05:41:37 +03:00
|
|
|
target_link_libraries(slugify PRIVATE LibUnicode)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(sql PRIVATE LibFileSystem LibIPC LibLine LibSQL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(su PRIVATE LibCrypt)
|
|
|
|
target_link_libraries(syscall PRIVATE LibSystem)
|
2023-01-09 02:03:39 +03:00
|
|
|
target_link_libraries(ttfdisasm PRIVATE LibGfx)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(tar PRIVATE LibArchive LibCompress LibFileSystem)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(telws PRIVATE LibProtocol LibLine LibURL)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(test-imap PRIVATE LibIMAP)
|
2024-01-14 05:36:30 +03:00
|
|
|
target_link_libraries(test-jpeg-roundtrip PRIVATE LibGfx)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(test-pthread PRIVATE LibThreading)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(touch PRIVATE LibFileSystem)
|
|
|
|
target_link_libraries(unzip PRIVATE LibArchive LibCompress LibCrypto LibFileSystem)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(update-cpp-test-results PRIVATE LibCpp)
|
|
|
|
target_link_libraries(useradd PRIVATE LibCrypt)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(userdel PRIVATE LibFileSystem)
|
2023-05-13 14:34:52 +03:00
|
|
|
target_link_libraries(usermod PRIVATE LibFileSystem)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(wallpaper PRIVATE LibGfx LibGUI)
|
2023-05-20 11:39:14 +03:00
|
|
|
target_link_libraries(wasm PRIVATE LibFileSystem LibJS LibLine LibWasm)
|
2023-03-21 18:35:30 +03:00
|
|
|
target_link_libraries(watch PRIVATE LibFileSystem)
|
2022-10-25 22:15:07 +03:00
|
|
|
target_link_libraries(wsctl PRIVATE LibGUI LibIPC)
|
2024-03-18 06:22:27 +03:00
|
|
|
target_link_libraries(xml PRIVATE LibFileSystem LibXML LibURL)
|
2024-02-10 16:13:24 +03:00
|
|
|
target_link_libraries(xxd PRIVATE LibUnicode)
|
2023-03-11 16:30:17 +03:00
|
|
|
target_link_libraries(xzcat PRIVATE LibCompress)
|
2023-06-02 19:33:07 +03:00
|
|
|
target_link_libraries(zip PRIVATE LibArchive LibFileSystem)
|
2022-11-22 04:03:45 +03:00
|
|
|
|
|
|
|
# FIXME: Link this file into headless-browser without compiling it again.
|
|
|
|
target_sources(headless-browser PRIVATE "${SerenityOS_SOURCE_DIR}/Userland/Services/WebContent/WebDriverConnection.cpp")
|
2023-05-23 00:14:37 +03:00
|
|
|
|
2023-05-23 01:34:01 +03:00
|
|
|
include("${SerenityOS_SOURCE_DIR}/Meta/Lagom/Fuzzers/fuzzers.cmake")
|
|
|
|
|
|
|
|
foreach(name IN LISTS FUZZER_TARGETS)
|
2023-05-23 00:14:37 +03:00
|
|
|
set(fuzz_source_file "${SerenityOS_SOURCE_DIR}/Meta/Lagom/Fuzzers/Fuzz${name}.cpp")
|
|
|
|
target_sources(test-fuzz PRIVATE "${fuzz_source_file}")
|
|
|
|
set_source_files_properties("${fuzz_source_file}" PROPERTIES COMPILE_DEFINITIONS "LLVMFuzzerTestOneInput=Test${name}")
|
|
|
|
set_source_files_properties("${fuzz_source_file}" PROPERTIES COMPILE_OPTIONS "-Wno-missing-declarations")
|
2023-05-23 01:34:01 +03:00
|
|
|
target_link_libraries(test-fuzz PRIVATE "${FUZZER_DEPENDENCIES_${name}}")
|
|
|
|
endforeach()
|
2023-05-20 23:04:43 +03:00
|
|
|
|
|
|
|
add_subdirectory(pkg)
|