2021-07-26 01:37:27 +00:00
|
|
|
cmake_minimum_required (VERSION 3.16)
|
|
|
|
|
|
|
|
project(
|
|
|
|
Lagom
|
|
|
|
VERSION 0.0.0
|
|
|
|
DESCRIPTION "Host build of SerenityOS libraries and applications"
|
|
|
|
HOMEPAGE_URL "https://github.com/SerenityOS/serenity"
|
|
|
|
LANGUAGES C CXX
|
|
|
|
)
|
2019-07-25 09:56:08 +00:00
|
|
|
|
2022-01-07 06:27:53 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11")
|
2021-09-07 08:21:36 +00:00
|
|
|
message(FATAL_ERROR
|
2022-01-07 06:27:53 +00:00
|
|
|
"A GCC version less than 11 was detected (${CMAKE_CXX_COMPILER_VERSION}), this is unsupported.\n"
|
2021-09-07 08:21:36 +00:00
|
|
|
"Please re-read the build instructions documentation, and upgrade your host compiler.\n")
|
2021-08-01 10:37:28 +00:00
|
|
|
endif()
|
|
|
|
|
2021-07-25 19:15:47 +00:00
|
|
|
# This is required for CMake (when invoked for a Lagom-only build) to
|
|
|
|
# ignore any files downloading during the build, e.g. UnicodeData.txt.
|
|
|
|
# https://cmake.org/cmake/help/latest/policy/CMP0058.html
|
|
|
|
cmake_policy(SET CMP0058 NEW)
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
get_filename_component(
|
|
|
|
SERENITY_PROJECT_ROOT "${PROJECT_SOURCE_DIR}/../.."
|
|
|
|
ABSOLUTE CACHE
|
|
|
|
)
|
|
|
|
|
2021-09-07 07:50:09 +00:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${SERENITY_PROJECT_ROOT}/Meta/CMake")
|
|
|
|
|
2021-09-07 08:08:54 +00:00
|
|
|
if(NOT COMMAND serenity_option)
|
|
|
|
macro(serenity_option)
|
|
|
|
set(${ARGV})
|
|
|
|
endmacro()
|
|
|
|
endif()
|
|
|
|
|
2022-03-18 11:31:36 +00:00
|
|
|
include(check_for_dependencies)
|
2021-09-07 08:08:54 +00:00
|
|
|
include(lagom_options)
|
|
|
|
|
2021-09-07 08:21:36 +00:00
|
|
|
if(ENABLE_ALL_THE_DEBUG_MACROS)
|
|
|
|
include(all_the_debug_macros)
|
|
|
|
endif()
|
|
|
|
|
2021-09-07 00:06:46 +00:00
|
|
|
# FIXME: BUILD_SHARED_LIBS has a default of OFF, as it's intended to be set by the
|
2021-11-23 17:34:31 +00:00
|
|
|
# user when configuring the project. We should instead change libjs-test262
|
2021-09-07 00:06:46 +00:00
|
|
|
# and oss-fuzz to set this option on their end, and enable it by default in
|
2022-02-19 23:09:40 +00:00
|
|
|
# Meta/serenity.sh. This is #9867.
|
2021-09-07 08:21:36 +00:00
|
|
|
option(BUILD_SHARED_LIBS "Build shared libraries instead of static libraries" ON)
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2021-08-17 02:10:34 +00:00
|
|
|
if (ENABLE_LAGOM_CCACHE)
|
|
|
|
find_program(CCACHE_PROGRAM ccache)
|
|
|
|
if(CCACHE_PROGRAM)
|
2021-09-07 08:21:36 +00:00
|
|
|
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE FILEPATH "Path to a compiler launcher program, e.g. ccache")
|
|
|
|
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE FILEPATH "Path to a compiler launcher program, e.g. ccache")
|
2021-08-17 02:10:34 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-03-21 10:36:41 +00:00
|
|
|
if (ENABLE_FUZZERS_LIBFUZZER OR ENABLE_FUZZERS_OSSFUZZ)
|
|
|
|
set(ENABLE_FUZZERS ON)
|
|
|
|
endif()
|
|
|
|
|
2021-09-07 07:50:09 +00:00
|
|
|
include(wasm_spec_tests)
|
2022-05-14 13:07:12 +00:00
|
|
|
include(lagom_compile_options)
|
2021-07-26 01:37:27 +00:00
|
|
|
|
2021-09-15 15:45:49 +00:00
|
|
|
include(GNUInstallDirs) # make sure to include before we mess w/RPATH
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|
|
|
# See slide 100 of the following ppt :^)
|
|
|
|
# https://crascit.com/wp-content/uploads/2019/09/Deep-CMake-For-Library-Authors-Craig-Scott-CppCon-2019.pdf
|
2021-09-15 15:45:49 +00:00
|
|
|
if (APPLE)
|
|
|
|
# FIXME: This doesn't work for the full BUILD_LAGOM=ON build, see #10055
|
|
|
|
set(CMAKE_MACOSX_RPATH TRUE)
|
|
|
|
set(CMAKE_INSTALL_NAME_DIR "@rpath")
|
|
|
|
set(CMAKE_INSTALL_RPATH "@loader_path/../lib")
|
|
|
|
else()
|
|
|
|
set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
|
2020-11-27 22:57:02 +00:00
|
|
|
endif()
|
2021-07-26 01:37:27 +00:00
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2021-07-28 00:22:12 +00:00
|
|
|
set(CMAKE_INSTALL_MESSAGE NEVER)
|
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
if (ENABLE_ADDRESS_SANITIZER)
|
2021-07-26 01:37:27 +00:00
|
|
|
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
|
2021-05-12 11:49:19 +00:00
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=address")
|
|
|
|
endif()
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
if (ENABLE_MEMORY_SANITIZER)
|
2021-07-26 01:37:27 +00:00
|
|
|
add_compile_options(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer)
|
2021-05-12 11:49:19 +00:00
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins")
|
|
|
|
endif()
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
if (ENABLE_UNDEFINED_SANITIZER)
|
2021-07-26 01:37:27 +00:00
|
|
|
add_compile_options(-fsanitize=undefined -fno-sanitize=vptr -fno-omit-frame-pointer)
|
2021-05-12 11:49:19 +00:00
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=undefined -fno-sanitize=vptr")
|
|
|
|
endif()
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2022-03-21 10:36:41 +00:00
|
|
|
if (ENABLE_FUZZERS)
|
|
|
|
add_compile_options(-fno-omit-frame-pointer)
|
|
|
|
endif()
|
|
|
|
|
2021-09-07 08:21:36 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
|
2021-05-12 11:49:19 +00:00
|
|
|
# Clang's default constexpr-steps limit is 1048576(2^20), GCC doesn't have one
|
2021-07-26 01:37:27 +00:00
|
|
|
add_compile_options(-Wno-overloaded-virtual -Wno-user-defined-literals -fconstexpr-steps=16777216)
|
2022-04-30 18:04:30 +00:00
|
|
|
# FIXME: Re-enable this check when the warning stops triggering, or document why we can't stop it from triggering.
|
|
|
|
# For now, there is a lot of unused private fields in LibWeb that trigger this that could be removed.
|
|
|
|
# See issue #14137 for details
|
|
|
|
add_compile_options(-Wno-unused-private-field)
|
2020-04-05 10:21:03 +00:00
|
|
|
|
2022-03-29 14:31:51 +00:00
|
|
|
if (ENABLE_FUZZERS_LIBFUZZER)
|
2022-03-21 10:36:41 +00:00
|
|
|
add_compile_options(-fsanitize=fuzzer)
|
2020-11-13 20:47:32 +00:00
|
|
|
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=fuzzer")
|
2020-04-08 08:40:02 +00:00
|
|
|
endif()
|
|
|
|
|
2021-09-07 08:21:36 +00:00
|
|
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2021-07-26 01:37:27 +00:00
|
|
|
add_compile_options(-Wno-expansion-to-defined)
|
2022-03-29 14:31:51 +00:00
|
|
|
if (ENABLE_FUZZERS_LIBFUZZER)
|
2022-02-19 23:09:40 +00:00
|
|
|
message(FATAL_ERROR
|
|
|
|
"Fuzzer Sanitizer (-fsanitize=fuzzer) is only supported for Fuzzer targets with LLVM. "
|
2022-03-21 10:36:41 +00:00
|
|
|
"Reconfigure CMake with -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER pointing to a clang-based toolchain "
|
|
|
|
"or build binaries without built-in fuzzing support by setting -DENABLE_FUZZERS instead."
|
2022-02-19 23:09:40 +00:00
|
|
|
)
|
|
|
|
endif()
|
2019-07-26 09:02:47 +00:00
|
|
|
endif()
|
2019-07-25 09:56:08 +00:00
|
|
|
|
2021-05-12 11:49:19 +00:00
|
|
|
# These are here to support Fuzzili builds further down the directory stack
|
|
|
|
set(ORIGINAL_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
set(ORIGINAL_CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
set(ORIGINAL_CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
configure_file(../../AK/Debug.h.in AK/Debug.h @ONLY)
|
|
|
|
|
2021-07-25 19:15:47 +00:00
|
|
|
include_directories(../../)
|
|
|
|
include_directories(../../Userland/)
|
|
|
|
include_directories(../../Userland/Libraries/)
|
|
|
|
include_directories(${CMAKE_BINARY_DIR})
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2021-07-28 00:22:12 +00:00
|
|
|
# install rules, think about moving to its own helper cmake file
|
2021-09-07 08:21:36 +00:00
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
|
|
|
|
# find_package(<package>) call for consumers to find this project
|
|
|
|
set(package Lagom)
|
|
|
|
|
|
|
|
# Allow package maintainers to freely override the path for the configs
|
|
|
|
set(Lagom_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${package}"
|
|
|
|
CACHE PATH "CMake package config location relative to the install prefix")
|
|
|
|
mark_as_advanced(Lagom_INSTALL_CMAKEDIR)
|
|
|
|
|
2022-05-20 05:46:36 +00:00
|
|
|
configure_file("${SERENITY_PROJECT_ROOT}/Meta/CMake/lagom-install-config.cmake.in" "${package}Config.cmake" @ONLY)
|
2021-09-07 08:21:36 +00:00
|
|
|
install(
|
2022-05-20 05:46:36 +00:00
|
|
|
FILES "${CMAKE_CURRENT_BINARY_DIR}/${package}Config.cmake"
|
2021-09-07 08:21:36 +00:00
|
|
|
DESTINATION "${Lagom_INSTALL_CMAKEDIR}"
|
|
|
|
COMPONENT Lagom_Development
|
|
|
|
)
|
2021-07-28 00:22:12 +00:00
|
|
|
|
2021-09-07 08:21:36 +00:00
|
|
|
install(
|
|
|
|
EXPORT LagomTargets
|
|
|
|
NAMESPACE Lagom::
|
|
|
|
DESTINATION "${Lagom_INSTALL_CMAKEDIR}"
|
|
|
|
COMPONENT Lagom_Development
|
|
|
|
)
|
2021-07-28 00:22:12 +00:00
|
|
|
|
|
|
|
function(lagom_lib library fs_name)
|
2021-07-26 01:37:27 +00:00
|
|
|
cmake_parse_arguments(LAGOM_LIBRARY "" "" "SOURCES;LIBS" ${ARGN})
|
2021-07-28 00:22:12 +00:00
|
|
|
set(target_name "Lagom${library}")
|
2021-08-01 10:37:28 +00:00
|
|
|
add_library(${target_name} ${LAGOM_LIBRARY_SOURCES})
|
2022-02-19 23:09:40 +00:00
|
|
|
|
|
|
|
# Don't make alias when we're going to import a previous build for Tools
|
|
|
|
# FIXME: Is there a better way to write this?
|
2022-03-21 10:36:41 +00:00
|
|
|
if (NOT ENABLE_FUZZERS)
|
2022-02-19 23:09:40 +00:00
|
|
|
# alias for parity with exports
|
|
|
|
add_library(Lagom::${library} ALIAS ${target_name})
|
|
|
|
endif()
|
2021-07-28 00:22:12 +00:00
|
|
|
|
|
|
|
set_target_properties(
|
|
|
|
${target_name} PROPERTIES
|
|
|
|
VERSION "${PROJECT_VERSION}"
|
|
|
|
SOVERSION "${PROJECT_VERSION_MAJOR}"
|
|
|
|
EXPORT_NAME ${library}
|
|
|
|
OUTPUT_NAME lagom-${fs_name}
|
|
|
|
)
|
2021-07-26 01:37:27 +00:00
|
|
|
target_link_libraries(${target_name} ${LAGOM_LIBRARY_LIBS})
|
|
|
|
if (NOT ${target_name} STREQUAL "LagomCore")
|
|
|
|
target_link_libraries(${target_name} LagomCore)
|
|
|
|
endif()
|
2021-09-07 08:21:36 +00:00
|
|
|
install(
|
|
|
|
TARGETS ${target_name}
|
|
|
|
EXPORT LagomTargets
|
|
|
|
RUNTIME #
|
|
|
|
COMPONENT Lagom_Runtime
|
|
|
|
LIBRARY #
|
|
|
|
COMPONENT Lagom_Runtime
|
|
|
|
NAMELINK_COMPONENT Lagom_Development
|
|
|
|
ARCHIVE #
|
2021-07-28 00:22:12 +00:00
|
|
|
COMPONENT Lagom_Development
|
2021-09-07 08:21:36 +00:00
|
|
|
INCLUDES #
|
2021-07-28 00:22:12 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
2021-09-07 08:21:36 +00:00
|
|
|
)
|
|
|
|
install(
|
|
|
|
DIRECTORY "${SERENITY_PROJECT_ROOT}/Userland/Libraries/Lib${library}"
|
|
|
|
COMPONENT Lagom_Development
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
|
|
FILES_MATCHING PATTERN "*.h"
|
|
|
|
)
|
2021-07-26 01:37:27 +00:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(lagom_test source)
|
2021-11-21 20:18:27 +00:00
|
|
|
cmake_parse_arguments(LAGOM_TEST "" "WORKING_DIRECTORY" "LIBS" ${ARGN})
|
2021-07-26 01:37:27 +00:00
|
|
|
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})
|
|
|
|
add_test(
|
|
|
|
NAME ${name}
|
|
|
|
COMMAND ${name}_lagom
|
2021-11-21 20:18:27 +00:00
|
|
|
WORKING_DIRECTORY ${LAGOM_TEST_WORKING_DIRECTORY}
|
2021-07-26 01:37:27 +00:00
|
|
|
)
|
|
|
|
endfunction()
|
|
|
|
|
2021-12-22 21:33:38 +00:00
|
|
|
if (NOT TARGET all_generated)
|
|
|
|
# Meta target to run all code-gen steps in the build.
|
|
|
|
add_custom_target(all_generated)
|
|
|
|
endif()
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# AK/Core
|
|
|
|
# Note: AK is included in LagomCore for the host build instead of LibC per the target build
|
2020-10-28 19:01:29 +00:00
|
|
|
file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../AK/*.cpp")
|
2021-01-12 11:17:30 +00:00
|
|
|
file(GLOB LIBCORE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCore/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Core core
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${AK_SOURCES} ${LIBCORE_SOURCES}
|
|
|
|
LIBS Threads::Threads
|
|
|
|
)
|
2021-12-23 00:32:00 +00:00
|
|
|
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)
|
2021-07-26 01:37:27 +00:00
|
|
|
endif()
|
2019-07-25 09:56:08 +00:00
|
|
|
|
2021-11-23 17:34:31 +00:00
|
|
|
# Main
|
|
|
|
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)
|
|
|
|
endif()
|
|
|
|
|
2021-12-22 21:33:38 +00:00
|
|
|
# TimeZone
|
|
|
|
# This is needed even if Lagom is not enabled because it is depended upon by code generators.
|
2022-02-19 23:09:40 +00:00
|
|
|
include(time_zone_data)
|
2021-12-22 21:33:38 +00:00
|
|
|
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}>)
|
|
|
|
|
2021-09-07 08:21:36 +00:00
|
|
|
# Manually install AK headers
|
|
|
|
install(
|
|
|
|
DIRECTORY "${SERENITY_PROJECT_ROOT}/AK"
|
|
|
|
COMPONENT Lagom_Development
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
|
|
FILES_MATCHING PATTERN "*.h"
|
|
|
|
)
|
|
|
|
|
2021-08-08 07:31:23 +00:00
|
|
|
# Code Generators and other host tools
|
|
|
|
# We need to make sure not to build code generators for Fuzzer builds, as they already have their own main.cpp
|
2022-02-19 23:09:40 +00:00
|
|
|
# Instead, we import them from a previous install of Lagom. This mandates a two-stage build for fuzzers.
|
2022-03-21 10:36:41 +00:00
|
|
|
if (ENABLE_FUZZERS)
|
2022-02-19 23:09:40 +00:00
|
|
|
find_package(Lagom REQUIRED)
|
|
|
|
else()
|
2021-08-08 07:31:23 +00:00
|
|
|
add_subdirectory(Tools)
|
|
|
|
endif()
|
|
|
|
|
2020-05-06 15:40:06 +00:00
|
|
|
if (BUILD_LAGOM)
|
2021-07-26 01:37:27 +00:00
|
|
|
# Lagom Libraries
|
|
|
|
|
|
|
|
# Archive
|
|
|
|
file(GLOB LIBARCHIVE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibArchive/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Archive archive
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBARCHIVE_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Audio
|
|
|
|
file(GLOB LIBAUDIO_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibAudio/*.cpp")
|
2022-02-25 10:18:30 +00:00
|
|
|
list(REMOVE_ITEM LIBAUDIO_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibAudio/ConnectionFromClient.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Audio audio
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBAUDIO_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Compress
|
|
|
|
file(GLOB LIBCOMPRESS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCompress/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Compress compress
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBCOMPRESS_SOURCES}
|
|
|
|
LIBS LagomCrypto
|
|
|
|
)
|
|
|
|
|
|
|
|
# Crypto
|
|
|
|
file(GLOB LIBCRYPTO_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*.cpp")
|
|
|
|
file(GLOB LIBCRYPTO_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*/*.cpp")
|
|
|
|
file(GLOB LIBCRYPTO_SUBSUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibCrypto/*/*/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Crypto crypto
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBCRYPTO_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBCRYPTO_SUBSUBDIR_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
# ELF
|
2022-02-08 16:11:03 +00:00
|
|
|
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
2022-01-17 23:54:36 +00:00
|
|
|
# for Lagom on Apple M1
|
|
|
|
if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
|
|
|
file(GLOB LIBELF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibELF/*.cpp")
|
|
|
|
# There's no way we can reliably make the dynamic loading classes cross platform
|
|
|
|
list(FILTER LIBELF_SOURCES EXCLUDE REGEX ".*Dynamic.*.cpp$")
|
|
|
|
lagom_lib(ELF elf
|
|
|
|
SOURCES ${LIBELF_SOURCES}
|
|
|
|
)
|
|
|
|
endif()
|
2021-07-26 01:37:27 +00:00
|
|
|
|
|
|
|
# Gemini
|
|
|
|
file(GLOB LIBGEMINI_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGemini/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Gemini gemini
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBGEMINI_SOURCES}
|
|
|
|
LIBS LagomTLS
|
|
|
|
)
|
|
|
|
|
2022-04-03 15:26:36 +00:00
|
|
|
# Gfx
|
2021-07-26 01:37:27 +00:00
|
|
|
file(GLOB LIBGFX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/*.cpp")
|
2022-04-03 16:20:57 +00:00
|
|
|
file(GLOB LIBGFX_FILTER_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/Filters/*.cpp")
|
2022-04-09 07:28:38 +00:00
|
|
|
file(GLOB LIBGFX_FONT_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/Font/*.cpp")
|
2022-04-09 06:52:59 +00:00
|
|
|
file(GLOB LIBGFX_TTF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/Font/TrueType/*.cpp")
|
2022-04-09 19:31:09 +00:00
|
|
|
file(GLOB LIBGFX_WOFF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGfx/Font/WOFF/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Gfx gfx
|
2022-04-03 16:20:57 +00:00
|
|
|
SOURCES ${LIBGFX_SOURCES} ${LIBGFX_FILTER_SOURCES} ${LIBGFX_FONT_SOURCES} ${LIBGFX_TTF_SOURCES} ${LIBGFX_WOFF_SOURCES}
|
2022-04-09 06:52:59 +00:00
|
|
|
LIBS m LagomCompress LagomTextCodec LagomIPC
|
|
|
|
)
|
2021-07-26 01:37:27 +00:00
|
|
|
|
2022-03-27 16:54:31 +00:00
|
|
|
# GPU
|
|
|
|
file(GLOB LIBGPU_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGPU/*.cpp")
|
|
|
|
lagom_lib(GPU gpu
|
|
|
|
SOURCES ${LIBGPU_SOURCES}
|
|
|
|
LIBS dl
|
|
|
|
)
|
|
|
|
|
2021-11-28 15:08:07 +00:00
|
|
|
# GL
|
|
|
|
file(GLOB LIBGL_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGL/*.cpp")
|
2022-01-07 12:04:05 +00:00
|
|
|
file(GLOB LIBGL_TEX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibGL/Tex/*.cpp")
|
2021-11-28 15:08:07 +00:00
|
|
|
lagom_lib(GL gl
|
2022-01-07 12:04:05 +00:00
|
|
|
SOURCES ${LIBGL_SOURCES} ${LIBGL_TEX_SOURCES}
|
2022-03-27 16:54:31 +00:00
|
|
|
LIBS m LagomGfx LagomGPU)
|
2021-11-28 15:08:07 +00:00
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# GUI-GML
|
2022-02-02 17:11:29 +00:00
|
|
|
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")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(GML gml
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBGUI_GML_SOURCES}
|
2022-02-21 14:07:01 +00:00
|
|
|
LIBS LagomSyntax
|
2021-07-26 01:37:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# HTTP
|
|
|
|
file(GLOB LIBHTTP_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibHTTP/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(HTTP http
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBHTTP_SOURCES}
|
|
|
|
LIBS LagomCompress LagomTLS
|
|
|
|
)
|
|
|
|
|
|
|
|
# IMAP
|
|
|
|
file(GLOB LIBIMAP_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibIMAP/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(IMAP imap
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBIMAP_SOURCES}
|
|
|
|
LIBS LagomTLS
|
|
|
|
)
|
|
|
|
|
|
|
|
# IPC
|
|
|
|
file(GLOB LIBIPC_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibIPC/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(IPC ipc
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBIPC_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
# JS
|
|
|
|
file(GLOB LIBJS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*.cpp")
|
|
|
|
file(GLOB LIBJS_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*/*.cpp")
|
|
|
|
file(GLOB LIBJS_SUBSUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibJS/*/*/*.cpp")
|
|
|
|
list(REMOVE_ITEM LIBJS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibJS/SyntaxHighlighter.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(JS js
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBJS_SUBSUBDIR_SOURCES}
|
2022-04-03 13:31:04 +00:00
|
|
|
LIBS m LagomCrypto LagomRegex LagomUnicode LagomTextCodec
|
2021-07-26 01:37:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Line
|
|
|
|
file(GLOB LIBLINE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibLine/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Line line
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBLINE_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Markdown
|
|
|
|
file(GLOB LIBMARKDOWN_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibMarkdown/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Markdown markdown
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBMARKDOWN_SOURCES}
|
|
|
|
LIBS LagomJS
|
|
|
|
)
|
|
|
|
|
2021-10-30 12:05:13 +00:00
|
|
|
# PDF
|
|
|
|
file(GLOB LIBPDF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibPDF/*.cpp")
|
2022-03-25 05:14:50 +00:00
|
|
|
file(GLOB LIBPDF_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibPDF/*/*.cpp")
|
2021-10-30 12:05:13 +00:00
|
|
|
lagom_lib(PDF pdf
|
2022-03-25 05:14:50 +00:00
|
|
|
SOURCES ${LIBPDF_SOURCES} ${LIBPDF_SUBDIR_SOURCES}
|
2021-10-30 12:05:13 +00:00
|
|
|
LIBS LagomGfx LagomIPC LagomTextCodec
|
|
|
|
)
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# Regex
|
|
|
|
file(GLOB LIBREGEX_LIBC_SOURCES "../../Userland/Libraries/LibRegex/C/Regex.cpp")
|
|
|
|
file(GLOB LIBREGEX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibRegex/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Regex regex
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBREGEX_SOURCES} ${LIBREGEX_LIBC_SOURCES}
|
2021-07-29 18:18:51 +00:00
|
|
|
LIBS LagomUnicode
|
2021-07-26 01:37:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Shell
|
|
|
|
file(GLOB SHELL_SOURCES CONFIGURE_DEPENDS "../../Userland/Shell/*.cpp")
|
|
|
|
list(REMOVE_ITEM SHELL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Shell/SyntaxHighlighter.cpp")
|
|
|
|
list(FILTER SHELL_SOURCES EXCLUDE REGEX ".*main.cpp$")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Shell shell
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${SHELL_SOURCES}
|
|
|
|
LIBS LagomLine LagomRegex
|
|
|
|
)
|
|
|
|
|
2021-12-16 19:32:38 +00:00
|
|
|
# SoftGPU
|
|
|
|
file(GLOB_RECURSE LIBSOFTGPU_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibSoftGPU/*.cpp")
|
|
|
|
lagom_lib(SoftGPU softgpu
|
|
|
|
SOURCES ${LIBSOFTGPU_SOURCES}
|
|
|
|
LIBS m LagomGfx
|
|
|
|
)
|
2022-01-07 13:00:51 +00:00
|
|
|
|
2022-02-21 14:07:01 +00:00
|
|
|
# Syntax
|
|
|
|
file(GLOB LIBSYNTAX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibSyntax/*.cpp")
|
|
|
|
lagom_lib(Syntax syntax
|
|
|
|
SOURCES ${LIBSYNTAX_SOURCES}
|
|
|
|
)
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# SQL
|
|
|
|
file(GLOB_RECURSE LIBSQL_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibSQL/*.cpp")
|
|
|
|
list(REMOVE_ITEM LIBSQL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibSQL/AST/SyntaxHighlighter.cpp")
|
|
|
|
list(REMOVE_ITEM LIBSQL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibSQL/SQLClient.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(SQL sql
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBSQL_SOURCES}
|
2021-12-29 14:47:29 +00:00
|
|
|
LIBS LagomRegex
|
2021-07-26 01:37:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# TextCodec
|
|
|
|
file(GLOB LIBTEXTCODEC_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTextCodec/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(TextCodec textcodec
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBTEXTCODEC_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
# TLS
|
|
|
|
file(GLOB LIBTLS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTLS/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(TLS tls
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBTLS_SOURCES}
|
|
|
|
LIBS LagomCrypto
|
|
|
|
)
|
|
|
|
|
|
|
|
# Unicode
|
2022-02-19 23:09:40 +00:00
|
|
|
include(unicode_data)
|
2021-07-26 01:37:27 +00:00
|
|
|
file(GLOB LIBUNICODE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibUnicode/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Unicode unicode
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBUNICODE_SOURCES} ${UNICODE_DATA_SOURCES}
|
|
|
|
)
|
2021-08-08 06:06:55 +00:00
|
|
|
target_compile_definitions(LagomUnicode PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
|
2022-01-07 13:43:23 +00:00
|
|
|
target_link_libraries(LagomUnicode LagomTimeZone)
|
2021-07-26 01:37:27 +00:00
|
|
|
|
|
|
|
# WASM
|
|
|
|
file(GLOB LIBWASM_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWasm/*/*.cpp")
|
2021-07-28 00:22:12 +00:00
|
|
|
lagom_lib(Wasm wasm
|
2021-07-26 01:37:27 +00:00
|
|
|
SOURCES ${LIBWASM_SOURCES}
|
|
|
|
)
|
|
|
|
|
2022-04-30 11:09:35 +00:00
|
|
|
# Web
|
|
|
|
include(libweb_generators)
|
|
|
|
file(GLOB LIBWEB_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWeb/*.cpp")
|
|
|
|
file(GLOB LIBWEB_SUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWeb/*/*.cpp")
|
|
|
|
file(GLOB LIBWEB_SUBSUBDIR_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWeb/*/*/*.cpp")
|
|
|
|
list(REMOVE_ITEM LIBWEB_SUBSUBDIR_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibWeb/CSS/SyntaxHighlighter/SyntaxHighlighter.cpp")
|
|
|
|
list(REMOVE_ITEM LIBWEB_SUBSUBDIR_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp")
|
|
|
|
|
|
|
|
generate_css_implementation()
|
|
|
|
|
|
|
|
set(LIBWEB_GENERATED_SOURCES
|
|
|
|
LibWeb/CSS/DefaultStyleSheetSource.cpp
|
|
|
|
LibWeb/CSS/Enums.cpp
|
|
|
|
LibWeb/CSS/MediaFeatureID.cpp
|
|
|
|
LibWeb/CSS/PropertyID.cpp
|
|
|
|
LibWeb/CSS/QuirksModeStyleSheetSource.cpp
|
|
|
|
LibWeb/CSS/TransformFunctions.cpp
|
|
|
|
LibWeb/CSS/ValueID.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
lagom_lib(Web web
|
|
|
|
SOURCES ${LIBWEB_SOURCES} ${LIBWEB_SUBDIR_SOURCES} ${LIBWEB_SUBSUBDIR_SOURCES} ${LIBWEB_GENERATED_SOURCES}
|
|
|
|
LIBS LagomMarkdown LagomGemini LagomGfx LagomJS LagomTextCodec LagomWasm LagomXML
|
|
|
|
)
|
|
|
|
generate_js_wrappers(LagomWeb)
|
|
|
|
|
2022-04-03 16:21:22 +00:00
|
|
|
# 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
|
|
|
|
)
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# x86
|
2022-02-08 16:11:03 +00:00
|
|
|
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
2022-01-17 23:54:36 +00:00
|
|
|
# for Lagom on Apple M1
|
|
|
|
if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
|
|
|
file(GLOB LIBX86_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibX86/*.cpp")
|
|
|
|
lagom_lib(X86 x86
|
|
|
|
SOURCES ${LIBX86_SOURCES}
|
|
|
|
)
|
|
|
|
endif()
|
2020-11-29 12:49:13 +00:00
|
|
|
|
2022-03-26 17:02:57 +00:00
|
|
|
file(GLOB LIBXML_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibXML/*/*.cpp")
|
|
|
|
lagom_lib(XML xml
|
|
|
|
SOURCES ${LIBXML_SOURCES})
|
|
|
|
|
2022-03-21 10:36:41 +00:00
|
|
|
if (NOT ENABLE_FUZZERS AND NOT ENABLE_COMPILER_EXPLORER_BUILD)
|
2021-07-26 01:37:27 +00:00
|
|
|
# Lagom Examples
|
2020-11-27 22:57:02 +00:00
|
|
|
add_executable(TestApp TestApp.cpp)
|
2021-07-26 01:37:27 +00:00
|
|
|
target_link_libraries(TestApp LagomCore)
|
2020-11-27 22:57:02 +00:00
|
|
|
|
|
|
|
add_executable(TestJson TestJson.cpp)
|
2021-07-26 01:37:27 +00:00
|
|
|
target_link_libraries(TestJson LagomCore)
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# Lagom Utilities
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(adjtime_lagom ../../Userland/Utilities/adjtime.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(adjtime_lagom PROPERTIES OUTPUT_NAME adjtime)
|
2022-01-17 06:22:35 +00:00
|
|
|
target_link_libraries(adjtime_lagom LagomCore LagomMain)
|
2021-07-26 01:37:27 +00:00
|
|
|
|
2022-02-08 16:11:03 +00:00
|
|
|
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
2022-01-17 23:54:36 +00:00
|
|
|
# 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)
|
|
|
|
endif()
|
2021-07-26 01:37:27 +00:00
|
|
|
|
|
|
|
add_executable(gml-format_lagom ../../Userland/Utilities/gml-format.cpp)
|
|
|
|
set_target_properties(gml-format_lagom PROPERTIES OUTPUT_NAME gml-format)
|
2022-01-13 20:03:08 +00:00
|
|
|
target_link_libraries(gml-format_lagom LagomCore LagomGML LagomMain)
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(js_lagom ../../Userland/Utilities/js.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(js_lagom PROPERTIES OUTPUT_NAME js)
|
2021-11-22 19:25:30 +00:00
|
|
|
target_link_libraries(js_lagom LagomJS LagomLine LagomMain Threads::Threads)
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2021-09-10 19:37:42 +00:00
|
|
|
add_executable(markdown-check_lagom ../../Userland/Utilities/markdown-check.cpp)
|
|
|
|
set_target_properties(markdown-check_lagom PROPERTIES OUTPUT_NAME markdown-check)
|
2022-03-28 18:59:25 +00:00
|
|
|
target_link_libraries(markdown-check_lagom LagomMarkdown LagomMain)
|
2021-09-10 19:37:42 +00:00
|
|
|
|
2021-01-12 10:57:58 +00:00
|
|
|
add_executable(ntpquery_lagom ../../Userland/Utilities/ntpquery.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(ntpquery_lagom PROPERTIES OUTPUT_NAME ntpquery)
|
2021-07-26 01:37:27 +00:00
|
|
|
target_link_libraries(ntpquery_lagom LagomCore)
|
|
|
|
|
|
|
|
add_executable(shell_lagom ../../Userland/Shell/main.cpp)
|
|
|
|
set_target_properties(shell_lagom PROPERTIES OUTPUT_NAME shell)
|
2022-01-03 00:59:39 +00:00
|
|
|
target_link_libraries(shell_lagom LagomCore LagomShell LagomMain)
|
2021-07-26 01:37:27 +00:00
|
|
|
|
|
|
|
add_executable(wasm_lagom ../../Userland/Utilities/wasm.cpp)
|
|
|
|
set_target_properties(wasm_lagom PROPERTIES OUTPUT_NAME wasm)
|
2022-01-08 17:41:38 +00:00
|
|
|
target_link_libraries(wasm_lagom LagomCore LagomWasm LagomLine LagomMain)
|
2021-07-26 01:37:27 +00:00
|
|
|
|
2022-03-26 17:02:57 +00:00
|
|
|
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)
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
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_SOURCES}
|
|
|
|
)
|
|
|
|
target_link_libraries(LagomTest LagomCore)
|
|
|
|
set_target_properties(LagomTest PROPERTIES OUTPUT_NAME lagom-test)
|
|
|
|
add_library(
|
|
|
|
LagomTestMain
|
|
|
|
OBJECT
|
|
|
|
"${SERENITY_PROJECT_ROOT}/Userland/Libraries/LibTest/TestMain.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
# LibTest tests from Tests/
|
|
|
|
# AK
|
|
|
|
file(GLOB AK_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/AK/*.cpp")
|
|
|
|
foreach(source ${AK_TEST_SOURCES})
|
2021-11-21 20:18:27 +00:00
|
|
|
lagom_test(${source} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/AK)
|
2021-07-26 01:37:27 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Core
|
2021-11-21 20:18:27 +00:00
|
|
|
lagom_test(../../Tests/LibCore/TestLibCoreIODevice.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibCore)
|
2021-07-26 01:37:27 +00:00
|
|
|
|
|
|
|
# Crypto
|
|
|
|
file(GLOB LIBCRYPTO_TESTS CONFIGURE_DEPENDS "../../Tests/LibCrypto/*.cpp")
|
|
|
|
foreach(source ${LIBCRYPTO_TESTS})
|
|
|
|
lagom_test(${source} LIBS LagomCrypto)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Compress
|
2022-03-31 19:07:45 +00:00
|
|
|
file(COPY "${SERENITY_PROJECT_ROOT}/Tests/LibCompress/brotli-test-files" DESTINATION "./")
|
2021-07-26 01:37:27 +00:00
|
|
|
file(GLOB LIBCOMPRESS_TESTS CONFIGURE_DEPENDS "../../Tests/LibCompress/*.cpp")
|
|
|
|
foreach(source ${LIBCOMPRESS_TESTS})
|
|
|
|
lagom_test(${source} LIBS LagomCompress)
|
|
|
|
endforeach()
|
|
|
|
|
2021-11-29 17:18:34 +00:00
|
|
|
# GL
|
2022-04-14 23:08:15 +00:00
|
|
|
file(COPY "${SERENITY_PROJECT_ROOT}/Tests/LibGL/reference-images" DESTINATION "./")
|
2021-11-29 17:18:34 +00:00
|
|
|
file(GLOB LIBGL_TESTS CONFIGURE_DEPENDS "../../Tests/LibGL/*.cpp")
|
|
|
|
foreach(source ${LIBGL_TESTS})
|
2022-04-14 23:08:15 +00:00
|
|
|
lagom_test(${source} WORKING_DIRECTORY LIBS LagomGL LagomGPU LagomSoftGPU)
|
2021-11-29 17:18:34 +00:00
|
|
|
endforeach()
|
|
|
|
|
2021-11-21 19:24:19 +00:00
|
|
|
# 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/)
|
|
|
|
endforeach()
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# Regex
|
|
|
|
file(GLOB LIBREGEX_TESTS CONFIGURE_DEPENDS "../../Tests/LibRegex/*.cpp")
|
|
|
|
# RegexLibC test POSIX <regex.h> and contains many Serenity extensions
|
|
|
|
# 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)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# SQL
|
|
|
|
file(GLOB LIBSQL_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibSQL/*.cpp")
|
|
|
|
foreach(source ${LIBSQL_TEST_SOURCES})
|
|
|
|
lagom_test(${source} LIBS LagomSQL)
|
|
|
|
endforeach()
|
|
|
|
|
2022-03-27 19:41:51 +00:00
|
|
|
# TextCodec
|
|
|
|
file(GLOB LIBTEXTCODEC_TESTS CONFIGURE_DEPENDS "../../Tests/LibTextCodec/*.cpp")
|
|
|
|
foreach(source ${LIBTEXTCODEC_TESTS})
|
|
|
|
lagom_test(${source} LIBS LagomTextCodec
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibTextCodec)
|
|
|
|
endforeach()
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# TLS
|
|
|
|
file(GLOB LIBTLS_TESTS CONFIGURE_DEPENDS "../../Tests/LibTLS/*.cpp")
|
|
|
|
foreach(source ${LIBTLS_TESTS})
|
2021-11-21 20:18:27 +00:00
|
|
|
lagom_test(${source} LIBS LagomTLS
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibTLS)
|
2021-07-26 01:37:27 +00:00
|
|
|
endforeach()
|
|
|
|
|
2022-04-03 15:26:36 +00:00
|
|
|
# TTF
|
|
|
|
file(GLOB LIBTTF_TESTS CONFIGURE_DEPENDS "../../Tests/LibTTF/*.cpp")
|
|
|
|
foreach(source ${LIBTTF_TESTS})
|
|
|
|
lagom_test(${source} LIBS LagomGfx)
|
|
|
|
endforeach()
|
|
|
|
|
2022-01-10 17:22:47 +00:00
|
|
|
# TimeZone
|
|
|
|
file(GLOB LIBTIMEZONE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibTimeZone/*.cpp")
|
|
|
|
foreach(source ${LIBTIMEZONE_TEST_SOURCES})
|
|
|
|
lagom_test(${source} LIBS LagomTimeZone)
|
|
|
|
|
|
|
|
get_filename_component(target "${source}" NAME_WLE)
|
|
|
|
target_compile_definitions("${target}_lagom" PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
|
|
|
|
endforeach()
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# Unicode
|
|
|
|
file(GLOB LIBUNICODE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibUnicode/*.cpp")
|
|
|
|
foreach(source ${LIBUNICODE_TEST_SOURCES})
|
|
|
|
lagom_test(${source} LIBS LagomUnicode)
|
|
|
|
endforeach()
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# JavaScriptTestRunner + LibTest tests
|
|
|
|
# test-js
|
2021-05-18 14:15:12 +00:00
|
|
|
add_executable(test-js_lagom
|
|
|
|
../../Tests/LibJS/test-js.cpp
|
|
|
|
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
|
2020-11-27 22:57:02 +00:00
|
|
|
set_target_properties(test-js_lagom PROPERTIES OUTPUT_NAME test-js)
|
2021-07-26 01:37:27 +00:00
|
|
|
target_link_libraries(test-js_lagom LagomCore LagomTest LagomJS)
|
2021-02-28 22:06:42 +00:00
|
|
|
add_test(
|
|
|
|
NAME JS
|
|
|
|
COMMAND test-js_lagom --show-progress=false
|
2020-06-25 12:45:23 +00:00
|
|
|
)
|
2021-07-26 01:37:27 +00:00
|
|
|
set_tests_properties(JS PROPERTIES ENVIRONMENT SERENITY_SOURCE_DIR=${SERENITY_PROJECT_ROOT})
|
2020-11-27 22:57:02 +00:00
|
|
|
|
2022-01-22 13:27:53 +00:00
|
|
|
# Extra tests from Tests/LibJS
|
2021-10-03 11:10:35 +00:00
|
|
|
lagom_test(../../Tests/LibJS/test-invalid-unicode-js.cpp LIBS LagomJS)
|
2022-01-22 13:27:53 +00:00
|
|
|
lagom_test(../../Tests/LibJS/test-bytecode-js.cpp LIBS LagomJS)
|
2021-10-03 11:10:35 +00:00
|
|
|
|
2022-02-22 04:19:04 +00:00
|
|
|
# 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)
|
|
|
|
add_test(
|
|
|
|
NAME Spreadsheet
|
|
|
|
COMMAND test-spreadsheet_lagom --show-progress=false
|
|
|
|
)
|
|
|
|
set_tests_properties(Spreadsheet PROPERTIES ENVIRONMENT SERENITY_SOURCE_DIR=${SERENITY_PROJECT_ROOT})
|
|
|
|
|
|
|
|
|
2021-08-29 20:19:12 +00:00
|
|
|
# Markdown
|
2021-09-07 07:50:09 +00:00
|
|
|
include(commonmark_spec)
|
2021-08-29 20:19:12 +00:00
|
|
|
file(GLOB LIBMARKDOWN_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibMarkdown/*.cpp")
|
|
|
|
foreach(source ${LIBMARKDOWN_TEST_SOURCES})
|
|
|
|
lagom_test(${source} LIBS LagomMarkdown)
|
|
|
|
endforeach()
|
|
|
|
set_tests_properties(TestCommonmark PROPERTIES DISABLED YES)
|
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# test-wasm
|
2021-05-04 03:06:59 +00:00
|
|
|
add_executable(test-wasm_lagom
|
|
|
|
../../Tests/LibWasm/test-wasm.cpp
|
|
|
|
../../Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp)
|
|
|
|
set_target_properties(test-wasm_lagom PROPERTIES OUTPUT_NAME test-wasm)
|
2021-07-26 01:37:27 +00:00
|
|
|
target_link_libraries(test-wasm_lagom LagomCore LagomTest LagomWasm LagomJS)
|
2021-05-04 03:06:59 +00:00
|
|
|
add_test(
|
|
|
|
NAME WasmParser
|
|
|
|
COMMAND test-wasm_lagom --show-progress=false
|
|
|
|
)
|
|
|
|
set_tests_properties(WasmParser PROPERTIES
|
2021-07-26 01:37:27 +00:00
|
|
|
ENVIRONMENT SERENITY_SOURCE_DIR=${SERENITY_PROJECT_ROOT}
|
2021-05-26 18:34:52 +00:00
|
|
|
SKIP_RETURN_CODE 1)
|
2021-05-04 03:06:59 +00:00
|
|
|
|
2021-07-26 01:37:27 +00:00
|
|
|
# Tests that are not LibTest based
|
|
|
|
# Shell
|
|
|
|
file(GLOB SHELL_TESTS CONFIGURE_DEPENDS "../../Userland/Shell/Tests/*.sh")
|
2020-11-27 22:57:02 +00:00
|
|
|
foreach(TEST_PATH ${SHELL_TESTS})
|
|
|
|
get_filename_component(TEST_NAME ${TEST_PATH} NAME_WE)
|
|
|
|
add_test(
|
|
|
|
NAME "Shell-${TEST_NAME}"
|
2021-01-18 06:38:30 +00:00
|
|
|
COMMAND shell_lagom --skip-shellrc "${TEST_PATH}"
|
2021-07-26 01:37:27 +00:00
|
|
|
WORKING_DIRECTORY ${SERENITY_PROJECT_ROOT}/Userland/Shell/Tests
|
2020-11-27 22:57:02 +00:00
|
|
|
)
|
2021-01-18 06:38:30 +00:00
|
|
|
set_tests_properties("Shell-${TEST_NAME}" PROPERTIES
|
|
|
|
TIMEOUT 10
|
|
|
|
FAIL_REGULAR_EXPRESSION "FAIL"
|
2021-02-27 11:36:11 +00:00
|
|
|
PASS_REGULAR_EXPRESSION "PASS"
|
|
|
|
)
|
2020-11-27 22:57:02 +00:00
|
|
|
endforeach()
|
2022-02-08 16:11:03 +00:00
|
|
|
|
|
|
|
# FIXME: When we are using CMake >= 3.21, the library installations can be replaced with RUNTIME_DEPENDENCIES.
|
|
|
|
# https://cmake.org/cmake/help/latest/command/install.html
|
|
|
|
include(get_linked_lagom_libraries.cmake)
|
|
|
|
get_linked_lagom_libraries(js_lagom js_lagom_libraries)
|
|
|
|
|
|
|
|
install(TARGETS js_lagom ${js_lagom_libraries} COMPONENT js)
|
|
|
|
|
|
|
|
set(CPACK_GENERATOR "TGZ")
|
|
|
|
set(CPACK_STRIP_FILES TRUE)
|
|
|
|
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
|
|
|
set(CPACK_COMPONENTS_ALL js)
|
|
|
|
set(CPACK_PACKAGE_FILE_NAME serenity-js)
|
|
|
|
include(CPack)
|
2020-11-27 22:57:02 +00:00
|
|
|
endif()
|
2020-05-06 15:40:06 +00:00
|
|
|
endif()
|
2020-04-11 11:16:17 +00:00
|
|
|
|
2022-03-21 10:36:41 +00:00
|
|
|
if (ENABLE_FUZZERS)
|
2020-04-08 08:40:02 +00:00
|
|
|
add_subdirectory(Fuzzers)
|
|
|
|
endif()
|