Meta: Rename Lagom library target names from LagomFoo to LibFoo
This matches the target names for the main serenity build, and will make simplifying the Lagom build much easier going forward. The LagomFoo name came from a time when we had both library builds in the same CMake generated project and needed to deconflict the names.
This commit is contained in:
parent
02e8f29560
commit
2b29e611fe
Notes:
sideshowbarker
2024-07-17 09:40:05 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/2b29e611fe Pull-request: https://github.com/SerenityOS/serenity/pull/14481
8 changed files with 136 additions and 138 deletions
|
@ -167,7 +167,7 @@ install(
|
|||
|
||||
function(lagom_lib library fs_name)
|
||||
cmake_parse_arguments(LAGOM_LIBRARY "" "" "SOURCES;LIBS" ${ARGN})
|
||||
set(target_name "Lagom${library}")
|
||||
set(target_name "Lib${library}")
|
||||
add_library(${target_name} ${LAGOM_LIBRARY_SOURCES})
|
||||
|
||||
# Don't make alias when we're going to import a previous build for Tools
|
||||
|
@ -185,8 +185,8 @@ function(lagom_lib library fs_name)
|
|||
OUTPUT_NAME lagom-${fs_name}
|
||||
)
|
||||
target_link_libraries(${target_name} ${LAGOM_LIBRARY_LIBS})
|
||||
if (NOT ${target_name} STREQUAL "LagomCore")
|
||||
target_link_libraries(${target_name} LagomCore)
|
||||
if (NOT ${target_name} STREQUAL "LibCore")
|
||||
target_link_libraries(${target_name} LibCore)
|
||||
endif()
|
||||
install(
|
||||
TARGETS ${target_name}
|
||||
|
@ -214,7 +214,7 @@ function(lagom_test source)
|
|||
get_filename_component(name ${source} NAME_WE)
|
||||
add_executable(${name}_lagom ${source})
|
||||
set_target_properties(${name}_lagom PROPERTIES OUTPUT_NAME ${name})
|
||||
target_link_libraries(${name}_lagom LagomCore LagomTest LagomTestMain ${LAGOM_TEST_LIBS})
|
||||
target_link_libraries(${name}_lagom LibCore LibTest LibTestMain ${LAGOM_TEST_LIBS})
|
||||
add_test(
|
||||
NAME ${name}
|
||||
COMMAND ${name}_lagom
|
||||
|
@ -227,38 +227,36 @@ if (NOT TARGET all_generated)
|
|||
add_custom_target(all_generated)
|
||||
endif()
|
||||
|
||||
# AK/Core
|
||||
# Note: AK is included in LagomCore for the host build instead of LibC per the target build
|
||||
# AK/LibCore
|
||||
# Note: AK is included in LibCore for the host build instead of LibC per the target build
|
||||
file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../AK/*.cpp")
|
||||
file(GLOB LIBCORE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCore/*.cpp")
|
||||
lagom_lib(Core core
|
||||
SOURCES ${AK_SOURCES} ${LIBCORE_SOURCES}
|
||||
LIBS Threads::Threads
|
||||
)
|
||||
if (APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||
target_link_libraries(LagomCore) # Core::Account uses crypt() but it's not in libcrypt on macOS
|
||||
else()
|
||||
target_link_libraries(LagomCore crypt)
|
||||
if (NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||
target_link_libraries(LibCore crypt) # LibCore::Account uses crypt() but it's not in libcrypt on macOS
|
||||
endif()
|
||||
|
||||
# Main
|
||||
# LibMain
|
||||
file(GLOB LIBMAIN_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibMain/*.cpp")
|
||||
lagom_lib(Main main
|
||||
SOURCES ${LIBMAIN_SOURCES}
|
||||
)
|
||||
# The macOS linker is not happy about LibMain's main() calling an undefined symbol (serenity_main()).
|
||||
if (APPLE)
|
||||
target_link_options(LagomMain PRIVATE -undefined dynamic_lookup)
|
||||
target_link_options(LibMain PRIVATE -undefined dynamic_lookup)
|
||||
endif()
|
||||
|
||||
# TimeZone
|
||||
# LibTimeZone
|
||||
# This is needed even if Lagom is not enabled because it is depended upon by code generators.
|
||||
include(time_zone_data)
|
||||
file(GLOB LIBTIMEZONE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTimeZone/*.cpp")
|
||||
lagom_lib(TimeZone timezone
|
||||
SOURCES ${LIBTIMEZONE_SOURCES} ${TIME_ZONE_DATA_SOURCES}
|
||||
)
|
||||
target_compile_definitions(LagomTimeZone PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
|
||||
target_compile_definitions(LibTimeZone PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
|
||||
|
||||
# Manually install AK headers
|
||||
install(
|
||||
|
@ -297,7 +295,7 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBCOMPRESS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCompress/*.cpp")
|
||||
lagom_lib(Compress compress
|
||||
SOURCES ${LIBCOMPRESS_SOURCES}
|
||||
LIBS LagomCrypto
|
||||
LIBS LibCrypto
|
||||
)
|
||||
|
||||
# Crypto
|
||||
|
@ -324,7 +322,7 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBGEMINI_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGemini/*.cpp")
|
||||
lagom_lib(Gemini gemini
|
||||
SOURCES ${LIBGEMINI_SOURCES}
|
||||
LIBS LagomTLS
|
||||
LIBS LibTLS
|
||||
)
|
||||
|
||||
# Gfx
|
||||
|
@ -335,7 +333,7 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBGFX_WOFF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/Font/WOFF/*.cpp")
|
||||
lagom_lib(Gfx gfx
|
||||
SOURCES ${LIBGFX_SOURCES} ${LIBGFX_FILTER_SOURCES} ${LIBGFX_FONT_SOURCES} ${LIBGFX_TTF_SOURCES} ${LIBGFX_WOFF_SOURCES}
|
||||
LIBS m LagomCompress LagomTextCodec LagomIPC
|
||||
LIBS m LibCompress LibTextCodec LibIPC
|
||||
)
|
||||
|
||||
# GPU
|
||||
|
@ -350,28 +348,28 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBGL_TEX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGL/Tex/*.cpp")
|
||||
lagom_lib(GL gl
|
||||
SOURCES ${LIBGL_SOURCES} ${LIBGL_TEX_SOURCES}
|
||||
LIBS m LagomGfx LagomGPU)
|
||||
LIBS m LibGfx LibGPU)
|
||||
|
||||
# GUI-GML
|
||||
file(GLOB LIBGUI_GML_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGUI/GML/*.cpp")
|
||||
list(REMOVE_ITEM LIBGUI_GML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp")
|
||||
lagom_lib(GML gml
|
||||
SOURCES ${LIBGUI_GML_SOURCES}
|
||||
LIBS LagomSyntax
|
||||
LIBS LibSyntax
|
||||
)
|
||||
|
||||
# HTTP
|
||||
file(GLOB LIBHTTP_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibHTTP/*.cpp")
|
||||
lagom_lib(HTTP http
|
||||
SOURCES ${LIBHTTP_SOURCES}
|
||||
LIBS LagomCompress LagomTLS
|
||||
LIBS LibCompress LibTLS
|
||||
)
|
||||
|
||||
# IMAP
|
||||
file(GLOB LIBIMAP_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibIMAP/*.cpp")
|
||||
lagom_lib(IMAP imap
|
||||
SOURCES ${LIBIMAP_SOURCES}
|
||||
LIBS LagomTLS
|
||||
LIBS LibTLS
|
||||
)
|
||||
|
||||
# IPC
|
||||
|
@ -387,7 +385,7 @@ if (BUILD_LAGOM)
|
|||
list(REMOVE_ITEM LIBJS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibJS/SyntaxHighlighter.cpp")
|
||||
lagom_lib(JS js
|
||||
SOURCES ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBJS_SUBSUBDIR_SOURCES}
|
||||
LIBS m LagomCrypto LagomRegex LagomUnicode LagomTextCodec
|
||||
LIBS m LibCrypto LibRegex LibUnicode LibTextCodec
|
||||
)
|
||||
|
||||
# Line
|
||||
|
@ -400,7 +398,7 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBMARKDOWN_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibMarkdown/*.cpp")
|
||||
lagom_lib(Markdown markdown
|
||||
SOURCES ${LIBMARKDOWN_SOURCES}
|
||||
LIBS LagomJS
|
||||
LIBS LibJS
|
||||
)
|
||||
|
||||
# PDF
|
||||
|
@ -408,7 +406,7 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBPDF_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibPDF/*/*.cpp")
|
||||
lagom_lib(PDF pdf
|
||||
SOURCES ${LIBPDF_SOURCES} ${LIBPDF_SUBDIR_SOURCES}
|
||||
LIBS LagomGfx LagomIPC LagomTextCodec
|
||||
LIBS LibGfx LibIPC LibTextCodec
|
||||
)
|
||||
|
||||
# Regex
|
||||
|
@ -416,7 +414,7 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBREGEX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibRegex/*.cpp")
|
||||
lagom_lib(Regex regex
|
||||
SOURCES ${LIBREGEX_SOURCES} ${LIBREGEX_LIBC_SOURCES}
|
||||
LIBS LagomUnicode
|
||||
LIBS LibUnicode
|
||||
)
|
||||
|
||||
# Shell
|
||||
|
@ -425,14 +423,14 @@ if (BUILD_LAGOM)
|
|||
list(FILTER SHELL_SOURCES EXCLUDE REGEX ".*main.cpp$")
|
||||
lagom_lib(Shell shell
|
||||
SOURCES ${SHELL_SOURCES}
|
||||
LIBS LagomLine LagomRegex
|
||||
LIBS LibLine LibRegex
|
||||
)
|
||||
|
||||
# SoftGPU
|
||||
file(GLOB_RECURSE LIBSOFTGPU_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibSoftGPU/*.cpp")
|
||||
lagom_lib(SoftGPU softgpu
|
||||
SOURCES ${LIBSOFTGPU_SOURCES}
|
||||
LIBS m LagomGfx
|
||||
LIBS m LibGfx
|
||||
)
|
||||
|
||||
# Syntax
|
||||
|
@ -447,7 +445,7 @@ if (BUILD_LAGOM)
|
|||
list(REMOVE_ITEM LIBSQL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibSQL/SQLClient.cpp")
|
||||
lagom_lib(SQL sql
|
||||
SOURCES ${LIBSQL_SOURCES}
|
||||
LIBS LagomRegex
|
||||
LIBS LibRegex
|
||||
)
|
||||
|
||||
# TextCodec
|
||||
|
@ -460,7 +458,7 @@ if (BUILD_LAGOM)
|
|||
file(GLOB LIBTLS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTLS/*.cpp")
|
||||
lagom_lib(TLS tls
|
||||
SOURCES ${LIBTLS_SOURCES}
|
||||
LIBS LagomCrypto
|
||||
LIBS LibCrypto
|
||||
)
|
||||
|
||||
# Unicode
|
||||
|
@ -469,8 +467,8 @@ if (BUILD_LAGOM)
|
|||
lagom_lib(Unicode unicode
|
||||
SOURCES ${LIBUNICODE_SOURCES} ${UNICODE_DATA_SOURCES}
|
||||
)
|
||||
target_compile_definitions(LagomUnicode PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
|
||||
target_link_libraries(LagomUnicode LagomTimeZone)
|
||||
target_compile_definitions(LibUnicode PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
|
||||
target_link_libraries(LibUnicode LibTimeZone)
|
||||
|
||||
# WASM
|
||||
file(GLOB LIBWASM_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWasm/*/*.cpp")
|
||||
|
@ -500,16 +498,16 @@ if (BUILD_LAGOM)
|
|||
|
||||
lagom_lib(Web web
|
||||
SOURCES ${LIBWEB_SOURCES} ${LIBWEB_SUBDIR_SOURCES} ${LIBWEB_SUBSUBDIR_SOURCES} ${LIBWEB_GENERATED_SOURCES}
|
||||
LIBS LagomMarkdown LagomGemini LagomGfx LagomGL LagomJS LagomTextCodec LagomWasm LagomXML
|
||||
LIBS LibMarkdown LibGemini LibGfx LibGL LibJS LibTextCodec LibWasm LibXML
|
||||
)
|
||||
generate_js_wrappers(LagomWeb)
|
||||
generate_js_wrappers(LibWeb)
|
||||
|
||||
# WebSocket
|
||||
file(GLOB LIBWEBSOCKET_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWebSocket/*.cpp")
|
||||
file(GLOB LIBWEBSOCKET_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWebSocket/*/*.cpp")
|
||||
lagom_lib(WebSocket websocket
|
||||
SOURCES ${LIBWEBSOCKET_SOURCES} ${LIBWEBSOCKET_SUBDIR_SOURCES}
|
||||
LIBS LagomCrypto LagomTLS
|
||||
LIBS LibCrypto LibTLS
|
||||
)
|
||||
|
||||
# x86
|
||||
|
@ -529,68 +527,68 @@ if (BUILD_LAGOM)
|
|||
if (NOT ENABLE_FUZZERS AND NOT ENABLE_COMPILER_EXPLORER_BUILD)
|
||||
# Lagom Examples
|
||||
add_executable(TestApp TestApp.cpp)
|
||||
target_link_libraries(TestApp LagomCore)
|
||||
target_link_libraries(TestApp LibCore)
|
||||
|
||||
add_executable(TestJson TestJson.cpp)
|
||||
target_link_libraries(TestJson LagomCore)
|
||||
target_link_libraries(TestJson LibCore)
|
||||
|
||||
# Lagom Utilities
|
||||
add_executable(adjtime_lagom ../../Userland/Utilities/adjtime.cpp)
|
||||
set_target_properties(adjtime_lagom PROPERTIES OUTPUT_NAME adjtime)
|
||||
target_link_libraries(adjtime_lagom LagomCore LagomMain)
|
||||
target_link_libraries(adjtime_lagom LibCore LibMain)
|
||||
|
||||
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
||||
# for Lagom on Apple M1
|
||||
if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
add_executable(disasm_lagom ../../Userland/Utilities/disasm.cpp)
|
||||
set_target_properties(disasm_lagom PROPERTIES OUTPUT_NAME disasm)
|
||||
target_link_libraries(disasm_lagom LagomCore LagomELF LagomX86 LagomMain)
|
||||
target_link_libraries(disasm_lagom LibCore LibELF LibX86 LibMain)
|
||||
endif()
|
||||
|
||||
add_executable(gml-format_lagom ../../Userland/Utilities/gml-format.cpp)
|
||||
set_target_properties(gml-format_lagom PROPERTIES OUTPUT_NAME gml-format)
|
||||
target_link_libraries(gml-format_lagom LagomCore LagomGML LagomMain)
|
||||
target_link_libraries(gml-format_lagom LibCore LibGML LibMain)
|
||||
|
||||
add_executable(headless_browser_lagom ../../Userland/Utilities/headless-browser.cpp)
|
||||
set_target_properties(headless_browser_lagom PROPERTIES OUTPUT_NAME headless-browser)
|
||||
target_link_libraries(headless_browser_lagom LagomWeb LagomWebSocket LagomHTTP LagomJS LagomGfx LagomMain)
|
||||
target_link_libraries(headless_browser_lagom LibWeb LibWebSocket LibHTTP LibJS LibGfx LibMain)
|
||||
|
||||
add_executable(js_lagom ../../Userland/Utilities/js.cpp)
|
||||
set_target_properties(js_lagom PROPERTIES OUTPUT_NAME js)
|
||||
target_link_libraries(js_lagom LagomJS LagomLine LagomMain Threads::Threads)
|
||||
target_link_libraries(js_lagom LibJS LibLine LibMain Threads::Threads)
|
||||
|
||||
add_executable(markdown-check_lagom ../../Userland/Utilities/markdown-check.cpp)
|
||||
set_target_properties(markdown-check_lagom PROPERTIES OUTPUT_NAME markdown-check)
|
||||
target_link_libraries(markdown-check_lagom LagomMarkdown LagomMain)
|
||||
target_link_libraries(markdown-check_lagom LibMarkdown LibMain)
|
||||
|
||||
add_executable(ntpquery_lagom ../../Userland/Utilities/ntpquery.cpp)
|
||||
set_target_properties(ntpquery_lagom PROPERTIES OUTPUT_NAME ntpquery)
|
||||
target_link_libraries(ntpquery_lagom LagomCore)
|
||||
target_link_libraries(ntpquery_lagom LibCore)
|
||||
|
||||
add_executable(shell_lagom ../../Userland/Shell/main.cpp)
|
||||
set_target_properties(shell_lagom PROPERTIES OUTPUT_NAME shell)
|
||||
target_link_libraries(shell_lagom LagomCore LagomShell LagomMain)
|
||||
target_link_libraries(shell_lagom LibCore LibShell LibMain)
|
||||
|
||||
add_executable(wasm_lagom ../../Userland/Utilities/wasm.cpp)
|
||||
set_target_properties(wasm_lagom PROPERTIES OUTPUT_NAME wasm)
|
||||
target_link_libraries(wasm_lagom LagomCore LagomWasm LagomLine LagomMain)
|
||||
target_link_libraries(wasm_lagom LibCore LibWasm LibLine LibMain)
|
||||
|
||||
add_executable(xml_lagom ../../Userland/Utilities/xml.cpp)
|
||||
set_target_properties(xml_lagom PROPERTIES OUTPUT_NAME xml)
|
||||
target_link_libraries(xml_lagom LagomCore LagomXML LagomMain)
|
||||
target_link_libraries(xml_lagom LibCore LibXML LibMain)
|
||||
|
||||
enable_testing()
|
||||
# LibTest
|
||||
file(GLOB LIBTEST_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTest/*.cpp")
|
||||
list(FILTER LIBTEST_SOURCES EXCLUDE REGEX ".*Main.cpp$")
|
||||
add_library(
|
||||
LagomTest
|
||||
LibTest
|
||||
${LIBTEST_SOURCES}
|
||||
)
|
||||
target_link_libraries(LagomTest LagomCore)
|
||||
set_target_properties(LagomTest PROPERTIES OUTPUT_NAME lagom-test)
|
||||
target_link_libraries(LibTest LibCore)
|
||||
set_target_properties(LibTest PROPERTIES OUTPUT_NAME lagom-test)
|
||||
add_library(
|
||||
LagomTestMain
|
||||
LibTestMain
|
||||
OBJECT
|
||||
"${SERENITY_PROJECT_ROOT}/Userland/Libraries/LibTest/TestMain.cpp"
|
||||
)
|
||||
|
@ -602,33 +600,33 @@ if (BUILD_LAGOM)
|
|||
lagom_test(${source} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/AK)
|
||||
endforeach()
|
||||
|
||||
# Core
|
||||
# LibCore
|
||||
lagom_test(../../Tests/LibCore/TestLibCoreIODevice.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibCore)
|
||||
|
||||
# Crypto
|
||||
file(GLOB LIBCRYPTO_TESTS CONFIGURE_DEPENDS "../../Tests/LibCrypto/*.cpp")
|
||||
foreach(source ${LIBCRYPTO_TESTS})
|
||||
lagom_test(${source} LIBS LagomCrypto)
|
||||
lagom_test(${source} LIBS LibCrypto)
|
||||
endforeach()
|
||||
|
||||
# Compress
|
||||
file(COPY "${SERENITY_PROJECT_ROOT}/Tests/LibCompress/brotli-test-files" DESTINATION "./")
|
||||
file(GLOB LIBCOMPRESS_TESTS CONFIGURE_DEPENDS "../../Tests/LibCompress/*.cpp")
|
||||
foreach(source ${LIBCOMPRESS_TESTS})
|
||||
lagom_test(${source} LIBS LagomCompress)
|
||||
lagom_test(${source} LIBS LibCompress)
|
||||
endforeach()
|
||||
|
||||
# GL
|
||||
file(COPY "${SERENITY_PROJECT_ROOT}/Tests/LibGL/reference-images" DESTINATION "./")
|
||||
file(GLOB LIBGL_TESTS CONFIGURE_DEPENDS "../../Tests/LibGL/*.cpp")
|
||||
foreach(source ${LIBGL_TESTS})
|
||||
lagom_test(${source} WORKING_DIRECTORY LIBS LagomGL LagomGPU LagomSoftGPU)
|
||||
lagom_test(${source} WORKING_DIRECTORY LIBS LibGL LibGPU LibSoftGPU)
|
||||
endforeach()
|
||||
|
||||
# PDF
|
||||
file(GLOB LIBPDF_TESTS CONFIGURE_DEPENDS "../../Tests/LibPDF/*.cpp")
|
||||
foreach(source ${LIBPDF_TESTS})
|
||||
lagom_test(${source} LIBS LagomPDF WORKING_DIRECTORY ${SERENITY_PROJECT_ROOT}/Base/home/anon/Documents/pdf/)
|
||||
lagom_test(${source} LIBS LibPDF WORKING_DIRECTORY ${SERENITY_PROJECT_ROOT}/Base/home/anon/Documents/pdf/)
|
||||
endforeach()
|
||||
|
||||
# Regex
|
||||
|
@ -637,39 +635,39 @@ if (BUILD_LAGOM)
|
|||
# It is therefore not reasonable to run it on Lagom
|
||||
list(REMOVE_ITEM LIBREGEX_TESTS "${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibRegex/RegexLibC.cpp")
|
||||
foreach(source ${LIBREGEX_TESTS})
|
||||
lagom_test(${source} LIBS LagomRegex)
|
||||
lagom_test(${source} LIBS LibRegex)
|
||||
endforeach()
|
||||
|
||||
# SQL
|
||||
file(GLOB LIBSQL_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibSQL/*.cpp")
|
||||
foreach(source ${LIBSQL_TEST_SOURCES})
|
||||
lagom_test(${source} LIBS LagomSQL)
|
||||
lagom_test(${source} LIBS LibSQL)
|
||||
endforeach()
|
||||
|
||||
# TextCodec
|
||||
file(GLOB LIBTEXTCODEC_TESTS CONFIGURE_DEPENDS "../../Tests/LibTextCodec/*.cpp")
|
||||
foreach(source ${LIBTEXTCODEC_TESTS})
|
||||
lagom_test(${source} LIBS LagomTextCodec
|
||||
lagom_test(${source} LIBS LibTextCodec
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibTextCodec)
|
||||
endforeach()
|
||||
|
||||
# TLS
|
||||
file(GLOB LIBTLS_TESTS CONFIGURE_DEPENDS "../../Tests/LibTLS/*.cpp")
|
||||
foreach(source ${LIBTLS_TESTS})
|
||||
lagom_test(${source} LIBS LagomTLS
|
||||
lagom_test(${source} LIBS LibTLS
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibTLS)
|
||||
endforeach()
|
||||
|
||||
# TTF
|
||||
file(GLOB LIBTTF_TESTS CONFIGURE_DEPENDS "../../Tests/LibTTF/*.cpp")
|
||||
foreach(source ${LIBTTF_TESTS})
|
||||
lagom_test(${source} LIBS LagomGfx)
|
||||
lagom_test(${source} LIBS LibGfx)
|
||||
endforeach()
|
||||
|
||||
# TimeZone
|
||||
# LibTimeZone
|
||||
file(GLOB LIBTIMEZONE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibTimeZone/*.cpp")
|
||||
foreach(source ${LIBTIMEZONE_TEST_SOURCES})
|
||||
lagom_test(${source} LIBS LagomTimeZone)
|
||||
lagom_test(${source} LIBS LibTimeZone)
|
||||
|
||||
get_filename_component(target "${source}" NAME_WLE)
|
||||
target_compile_definitions("${target}_lagom" PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
|
||||
|
@ -678,7 +676,7 @@ if (BUILD_LAGOM)
|
|||
# Unicode
|
||||
file(GLOB LIBUNICODE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibUnicode/*.cpp")
|
||||
foreach(source ${LIBUNICODE_TEST_SOURCES})
|
||||
lagom_test(${source} LIBS LagomUnicode)
|
||||
lagom_test(${source} LIBS LibUnicode)
|
||||
endforeach()
|
||||
|
||||
# JavaScriptTestRunner + LibTest tests
|
||||
|
@ -687,7 +685,7 @@ if (BUILD_LAGOM)
|
|||
../../Tests/LibJS/test-js.cpp
|
||||
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
|
||||
set_target_properties(test-js_lagom PROPERTIES OUTPUT_NAME test-js)
|
||||
target_link_libraries(test-js_lagom LagomCore LagomTest LagomJS)
|
||||
target_link_libraries(test-js_lagom LibCore LibTest LibJS)
|
||||
add_test(
|
||||
NAME JS
|
||||
COMMAND test-js_lagom --show-progress=false
|
||||
|
@ -695,15 +693,15 @@ if (BUILD_LAGOM)
|
|||
set_tests_properties(JS PROPERTIES ENVIRONMENT SERENITY_SOURCE_DIR=${SERENITY_PROJECT_ROOT})
|
||||
|
||||
# Extra tests from Tests/LibJS
|
||||
lagom_test(../../Tests/LibJS/test-invalid-unicode-js.cpp LIBS LagomJS)
|
||||
lagom_test(../../Tests/LibJS/test-bytecode-js.cpp LIBS LagomJS)
|
||||
lagom_test(../../Tests/LibJS/test-invalid-unicode-js.cpp LIBS LibJS)
|
||||
lagom_test(../../Tests/LibJS/test-bytecode-js.cpp LIBS LibJS)
|
||||
|
||||
# Spreadsheet
|
||||
add_executable(test-spreadsheet_lagom
|
||||
../../Tests/Spreadsheet/test-spreadsheet.cpp
|
||||
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
|
||||
set_target_properties(test-spreadsheet_lagom PROPERTIES OUTPUT_NAME test-spreadsheet)
|
||||
target_link_libraries(test-spreadsheet_lagom LagomCore LagomTest LagomJS)
|
||||
target_link_libraries(test-spreadsheet_lagom LibCore LibTest LibJS)
|
||||
add_test(
|
||||
NAME Spreadsheet
|
||||
COMMAND test-spreadsheet_lagom --show-progress=false
|
||||
|
@ -715,7 +713,7 @@ if (BUILD_LAGOM)
|
|||
include(commonmark_spec)
|
||||
file(GLOB LIBMARKDOWN_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibMarkdown/*.cpp")
|
||||
foreach(source ${LIBMARKDOWN_TEST_SOURCES})
|
||||
lagom_test(${source} LIBS LagomMarkdown)
|
||||
lagom_test(${source} LIBS LibMarkdown)
|
||||
endforeach()
|
||||
set_tests_properties(TestCommonmark PROPERTIES DISABLED YES)
|
||||
|
||||
|
@ -724,7 +722,7 @@ if (BUILD_LAGOM)
|
|||
../../Tests/LibWasm/test-wasm.cpp
|
||||
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
|
||||
set_target_properties(test-wasm_lagom PROPERTIES OUTPUT_NAME test-wasm)
|
||||
target_link_libraries(test-wasm_lagom LagomCore LagomTest LagomWasm LagomJS)
|
||||
target_link_libraries(test-wasm_lagom LibCore LibTest LibWasm LibJS)
|
||||
add_test(
|
||||
NAME WasmParser
|
||||
COMMAND test-wasm_lagom --show-progress=false
|
||||
|
|
|
@ -3,73 +3,73 @@ function(add_simple_fuzzer name)
|
|||
|
||||
if (ENABLE_FUZZERS_OSSFUZZ)
|
||||
target_link_libraries(${name}
|
||||
PUBLIC ${ARGN} LagomCore)
|
||||
PUBLIC ${ARGN} LibCore)
|
||||
elseif (ENABLE_FUZZERS_LIBFUZZER)
|
||||
target_compile_options(${name}
|
||||
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer>
|
||||
)
|
||||
target_link_libraries(${name}
|
||||
PUBLIC ${ARGN} LagomCore
|
||||
PUBLIC ${ARGN} LibCore
|
||||
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-fsanitize=fuzzer>
|
||||
)
|
||||
else()
|
||||
target_sources(${name} PRIVATE "EntryShim.cpp")
|
||||
target_link_libraries(${name} PUBLIC ${ARGN} LagomCore)
|
||||
target_link_libraries(${name} PUBLIC ${ARGN} LibCore)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_simple_fuzzer(FuzzBMPLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzBrotli LagomCompress)
|
||||
add_simple_fuzzer(FuzzCSSParser LagomWeb)
|
||||
add_simple_fuzzer(FuzzCyrillicDecoder LagomTextCodec)
|
||||
add_simple_fuzzer(FuzzDeflateCompression LagomCompress)
|
||||
add_simple_fuzzer(FuzzDeflateDecompression LagomCompress)
|
||||
add_simple_fuzzer(FuzzELF LagomELF)
|
||||
add_simple_fuzzer(FuzzFlacLoader LagomAudio)
|
||||
add_simple_fuzzer(FuzzGemini LagomGemini)
|
||||
add_simple_fuzzer(FuzzGIFLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzGzipCompression LagomCompress)
|
||||
add_simple_fuzzer(FuzzGzipDecompression LagomCompress)
|
||||
add_simple_fuzzer(FuzzICOLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzJPGLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzMD5 LagomCrypto)
|
||||
add_simple_fuzzer(FuzzMP3Loader LagomAudio)
|
||||
add_simple_fuzzer(FuzzPEM LagomCrypto)
|
||||
add_simple_fuzzer(FuzzPNGLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzPBMLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzPGMLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzPoly1305 LagomCrypto)
|
||||
add_simple_fuzzer(FuzzPPMLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzPDF LagomPDF)
|
||||
add_simple_fuzzer(FuzzQOILoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzQuotedPrintableParser LagomIMAP)
|
||||
add_simple_fuzzer(FuzzHebrewDecoder LagomTextCodec)
|
||||
add_simple_fuzzer(FuzzHttpRequest LagomHTTP)
|
||||
add_simple_fuzzer(FuzzIMAPParser LagomIMAP)
|
||||
add_simple_fuzzer(FuzzJs LagomJS)
|
||||
add_simple_fuzzer(FuzzLatin1Decoder LagomTextCodec)
|
||||
add_simple_fuzzer(FuzzLatin2Decoder LagomTextCodec)
|
||||
add_simple_fuzzer(FuzzMarkdown LagomMarkdown)
|
||||
add_simple_fuzzer(FuzzRegexECMA262 LagomRegex)
|
||||
add_simple_fuzzer(FuzzRegexPosixBasic LagomRegex)
|
||||
add_simple_fuzzer(FuzzRegexPosixExtended LagomRegex)
|
||||
add_simple_fuzzer(FuzzASN1 LagomCrypto LagomTLS)
|
||||
add_simple_fuzzer(FuzzSHA1 LagomCrypto)
|
||||
add_simple_fuzzer(FuzzSHA256 LagomCrypto)
|
||||
add_simple_fuzzer(FuzzSHA384 LagomCrypto)
|
||||
add_simple_fuzzer(FuzzSHA512 LagomCrypto)
|
||||
add_simple_fuzzer(FuzzShell LagomShell)
|
||||
add_simple_fuzzer(FuzzSQLParser LagomSQL)
|
||||
add_simple_fuzzer(FuzzTTF LagomGfx)
|
||||
add_simple_fuzzer(FuzzBMPLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzBrotli LibCompress)
|
||||
add_simple_fuzzer(FuzzCSSParser LibWeb)
|
||||
add_simple_fuzzer(FuzzCyrillicDecoder LibTextCodec)
|
||||
add_simple_fuzzer(FuzzDeflateCompression LibCompress)
|
||||
add_simple_fuzzer(FuzzDeflateDecompression LibCompress)
|
||||
add_simple_fuzzer(FuzzELF LibELF)
|
||||
add_simple_fuzzer(FuzzFlacLoader LibAudio)
|
||||
add_simple_fuzzer(FuzzGemini LibGemini)
|
||||
add_simple_fuzzer(FuzzGIFLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzGzipCompression LibCompress)
|
||||
add_simple_fuzzer(FuzzGzipDecompression LibCompress)
|
||||
add_simple_fuzzer(FuzzICOLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzJPGLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzMD5 LibCrypto)
|
||||
add_simple_fuzzer(FuzzMP3Loader LibAudio)
|
||||
add_simple_fuzzer(FuzzPEM LibCrypto)
|
||||
add_simple_fuzzer(FuzzPNGLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzPBMLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzPGMLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzPoly1305 LibCrypto)
|
||||
add_simple_fuzzer(FuzzPPMLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzPDF LibPDF)
|
||||
add_simple_fuzzer(FuzzQOILoader LibGfx)
|
||||
add_simple_fuzzer(FuzzQuotedPrintableParser LibIMAP)
|
||||
add_simple_fuzzer(FuzzHebrewDecoder LibTextCodec)
|
||||
add_simple_fuzzer(FuzzHttpRequest LibHTTP)
|
||||
add_simple_fuzzer(FuzzIMAPParser LibIMAP)
|
||||
add_simple_fuzzer(FuzzJs LibJS)
|
||||
add_simple_fuzzer(FuzzLatin1Decoder LibTextCodec)
|
||||
add_simple_fuzzer(FuzzLatin2Decoder LibTextCodec)
|
||||
add_simple_fuzzer(FuzzMarkdown LibMarkdown)
|
||||
add_simple_fuzzer(FuzzRegexECMA262 LibRegex)
|
||||
add_simple_fuzzer(FuzzRegexPosixBasic LibRegex)
|
||||
add_simple_fuzzer(FuzzRegexPosixExtended LibRegex)
|
||||
add_simple_fuzzer(FuzzASN1 LibCrypto LibTLS)
|
||||
add_simple_fuzzer(FuzzSHA1 LibCrypto)
|
||||
add_simple_fuzzer(FuzzSHA256 LibCrypto)
|
||||
add_simple_fuzzer(FuzzSHA384 LibCrypto)
|
||||
add_simple_fuzzer(FuzzSHA512 LibCrypto)
|
||||
add_simple_fuzzer(FuzzShell LibShell)
|
||||
add_simple_fuzzer(FuzzSQLParser LibSQL)
|
||||
add_simple_fuzzer(FuzzTTF LibGfx)
|
||||
add_simple_fuzzer(FuzzURL)
|
||||
add_simple_fuzzer(FuzzUTF16BEDecoder LagomTextCodec)
|
||||
add_simple_fuzzer(FuzzRSAKeyParsing LagomCrypto)
|
||||
add_simple_fuzzer(FuzzWAVLoader LagomAudio)
|
||||
add_simple_fuzzer(FuzzWasmParser LagomWasm)
|
||||
add_simple_fuzzer(FuzzWOFF LagomGfx)
|
||||
add_simple_fuzzer(FuzzXML LagomXML)
|
||||
add_simple_fuzzer(FuzzZip LagomArchive)
|
||||
add_simple_fuzzer(FuzzZlibDecompression LagomCompress)
|
||||
add_simple_fuzzer(FuzzUTF16BEDecoder LibTextCodec)
|
||||
add_simple_fuzzer(FuzzRSAKeyParsing LibCrypto)
|
||||
add_simple_fuzzer(FuzzWAVLoader LibAudio)
|
||||
add_simple_fuzzer(FuzzWasmParser LibWasm)
|
||||
add_simple_fuzzer(FuzzWOFF LibGfx)
|
||||
add_simple_fuzzer(FuzzXML LibXML)
|
||||
add_simple_fuzzer(FuzzZip LibArchive)
|
||||
add_simple_fuzzer(FuzzZlibDecompression LibCompress)
|
||||
|
||||
if (ENABLE_FUZZERS_LIBFUZZER)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${ORIGINAL_CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
|
@ -80,7 +80,7 @@ target_compile_options(FuzzilliJs
|
|||
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-g -O1 -fsanitize-coverage=trace-pc-guard>
|
||||
)
|
||||
target_link_libraries(FuzzilliJs
|
||||
PUBLIC LagomCore LagomJS
|
||||
PUBLIC LibCore LibJS
|
||||
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-fsanitize-coverage=trace-pc-guard>
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -3,7 +3,7 @@ function(lagom_tool tool)
|
|||
add_executable(${tool} ${SOURCES} ${LAGOM_TOOL_SOURCES})
|
||||
# alias for parity with exports
|
||||
add_executable(Lagom::${tool} ALIAS ${tool})
|
||||
target_link_libraries(${tool} LagomCore ${LAGOM_TOOL_LIBS})
|
||||
target_link_libraries(${tool} LibCore ${LAGOM_TOOL_LIBS})
|
||||
install(
|
||||
TARGETS ${tool}
|
||||
EXPORT LagomTargets
|
||||
|
|
|
@ -2,4 +2,4 @@ set(SOURCES
|
|||
main.cpp
|
||||
)
|
||||
|
||||
lagom_tool(IPCCompiler LIBS LagomMain)
|
||||
lagom_tool(IPCCompiler LIBS LibMain)
|
||||
|
|
|
@ -1 +1 @@
|
|||
lagom_tool(GeneratePnpIDsData SOURCES GeneratePnpIDs.cpp LIBS LagomMain)
|
||||
lagom_tool(GeneratePnpIDsData SOURCES GeneratePnpIDs.cpp LIBS LibMain)
|
||||
|
|
|
@ -1 +1 @@
|
|||
lagom_tool(GenerateTimeZoneData SOURCES GenerateTimeZoneData.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateTimeZoneData SOURCES GenerateTimeZoneData.cpp LIBS LibMain)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
lagom_tool(GenerateUnicodeData SOURCES GenerateUnicodeData.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateUnicodeDateTimeFormat SOURCES GenerateUnicodeDateTimeFormat.cpp LIBS LagomMain LagomTimeZone)
|
||||
lagom_tool(GenerateUnicodeLocale SOURCES GenerateUnicodeLocale.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateUnicodeNumberFormat SOURCES GenerateUnicodeNumberFormat.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateUnicodeRelativeTimeFormat SOURCES GenerateUnicodeRelativeTimeFormat.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateUnicodeData SOURCES GenerateUnicodeData.cpp LIBS LibMain)
|
||||
lagom_tool(GenerateUnicodeDateTimeFormat SOURCES GenerateUnicodeDateTimeFormat.cpp LIBS LibMain LibTimeZone)
|
||||
lagom_tool(GenerateUnicodeLocale SOURCES GenerateUnicodeLocale.cpp LIBS LibMain)
|
||||
lagom_tool(GenerateUnicodeNumberFormat SOURCES GenerateUnicodeNumberFormat.cpp LIBS LibMain)
|
||||
lagom_tool(GenerateUnicodeRelativeTimeFormat SOURCES GenerateUnicodeRelativeTimeFormat.cpp LIBS LibMain)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
set(SOURCES "") # avoid pulling SOURCES from parent scope
|
||||
|
||||
lagom_tool(GenerateCSSEnums SOURCES GenerateCSSEnums.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateCSSMediaFeatureID SOURCES GenerateCSSMediaFeatureID.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateCSSPropertyID SOURCES GenerateCSSPropertyID.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateCSSTransformFunctions SOURCES GenerateCSSTransformFunctions.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateCSSValueID SOURCES GenerateCSSValueID.cpp LIBS LagomMain)
|
||||
lagom_tool(GenerateCSSEnums SOURCES GenerateCSSEnums.cpp LIBS LibMain)
|
||||
lagom_tool(GenerateCSSMediaFeatureID SOURCES GenerateCSSMediaFeatureID.cpp LIBS LibMain)
|
||||
lagom_tool(GenerateCSSPropertyID SOURCES GenerateCSSPropertyID.cpp LIBS LibMain)
|
||||
lagom_tool(GenerateCSSTransformFunctions SOURCES GenerateCSSTransformFunctions.cpp LIBS LibMain)
|
||||
lagom_tool(GenerateCSSValueID SOURCES GenerateCSSValueID.cpp LIBS LibMain)
|
||||
|
||||
add_subdirectory(WrapperGenerator)
|
||||
|
|
Loading…
Add table
Reference in a new issue