|
@@ -23,6 +23,7 @@ get_filename_component(
|
|
SERENITY_PROJECT_ROOT "${PROJECT_SOURCE_DIR}/../.."
|
|
SERENITY_PROJECT_ROOT "${PROJECT_SOURCE_DIR}/../.."
|
|
ABSOLUTE CACHE
|
|
ABSOLUTE CACHE
|
|
)
|
|
)
|
|
|
|
+set(SerenityOS_SOURCE_DIR "${SERENITY_PROJECT_ROOT}" CACHE STRING "")
|
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${SERENITY_PROJECT_ROOT}/Meta/CMake")
|
|
list(APPEND CMAKE_MODULE_PATH "${SERENITY_PROJECT_ROOT}/Meta/CMake")
|
|
|
|
|
|
@@ -137,8 +138,11 @@ configure_file(../../AK/Debug.h.in AK/Debug.h @ONLY)
|
|
include_directories(../../)
|
|
include_directories(../../)
|
|
include_directories(../../Userland/)
|
|
include_directories(../../Userland/)
|
|
include_directories(../../Userland/Libraries/)
|
|
include_directories(../../Userland/Libraries/)
|
|
|
|
+include_directories(../../Userland/Services)
|
|
include_directories(${CMAKE_BINARY_DIR})
|
|
include_directories(${CMAKE_BINARY_DIR})
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
+include_directories(${CMAKE_BINARY_DIR}/Libraries)
|
|
|
|
+include_directories(${CMAKE_BINARY_DIR}/Services)
|
|
|
|
|
|
# install rules, think about moving to its own helper cmake file
|
|
# install rules, think about moving to its own helper cmake file
|
|
include(CMakePackageConfigHelpers)
|
|
include(CMakePackageConfigHelpers)
|
|
@@ -222,6 +226,31 @@ function(lagom_test source)
|
|
)
|
|
)
|
|
endfunction()
|
|
endfunction()
|
|
|
|
|
|
|
|
+function(serenity_bin name)
|
|
|
|
+ add_executable(${name} ${SOURCES} ${GENERATED_SOURCES})
|
|
|
|
+ add_executable(Lagom::${name} ALIAS ${name})
|
|
|
|
+ install(
|
|
|
|
+ TARGETS ${target_name}
|
|
|
|
+ EXPORT LagomTargets
|
|
|
|
+ RUNTIME #
|
|
|
|
+ COMPONENT Lagom_Runtime
|
|
|
|
+ LIBRARY #
|
|
|
|
+ COMPONENT Lagom_Runtime
|
|
|
|
+ NAMELINK_COMPONENT Lagom_Development
|
|
|
|
+ ARCHIVE #
|
|
|
|
+ COMPONENT Lagom_Development
|
|
|
|
+ INCLUDES #
|
|
|
|
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
|
|
+ )
|
|
|
|
+endfunction()
|
|
|
|
+
|
|
|
|
+function(serenity_lib name fs_name)
|
|
|
|
+ lagom_lib(name fs_name SOURCES ${SOURCES} ${GENERATED_SOURCES})
|
|
|
|
+endfunction()
|
|
|
|
+
|
|
|
|
+add_custom_target(components ALL)
|
|
|
|
+option(BUILD_EVERYTHING "Build all optional components" ON)
|
|
|
|
+
|
|
if (NOT TARGET all_generated)
|
|
if (NOT TARGET all_generated)
|
|
# Meta target to run all code-gen steps in the build.
|
|
# Meta target to run all code-gen steps in the build.
|
|
add_custom_target(all_generated)
|
|
add_custom_target(all_generated)
|
|
@@ -306,6 +335,12 @@ if (BUILD_LAGOM)
|
|
SOURCES ${LIBCRYPTO_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBCRYPTO_SUBSUBDIR_SOURCES}
|
|
SOURCES ${LIBCRYPTO_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBCRYPTO_SUBSUBDIR_SOURCES}
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ file(GLOB LIBDNS_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibDNS/*.cpp")
|
|
|
|
+ lagom_lib(DNS dns
|
|
|
|
+ SOURCES ${LIBDNS_SOURCES}
|
|
|
|
+ LIBS LibIPC
|
|
|
|
+ )
|
|
|
|
+
|
|
# ELF
|
|
# ELF
|
|
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
|
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
|
# for Lagom on Apple M1
|
|
# for Lagom on Apple M1
|
|
@@ -525,6 +560,9 @@ if (BUILD_LAGOM)
|
|
SOURCES ${LIBXML_SOURCES})
|
|
SOURCES ${LIBXML_SOURCES})
|
|
|
|
|
|
if (NOT ENABLE_FUZZERS AND NOT ENABLE_COMPILER_EXPLORER_BUILD)
|
|
if (NOT ENABLE_FUZZERS AND NOT ENABLE_COMPILER_EXPLORER_BUILD)
|
|
|
|
+ # Lagom Services
|
|
|
|
+ add_subdirectory("${SERENITY_PROJECT_ROOT}/Userland/Services" "${CMAKE_CURRENT_BINARY_DIR}/Services")
|
|
|
|
+
|
|
# Lagom Examples
|
|
# Lagom Examples
|
|
add_executable(TestApp TestApp.cpp)
|
|
add_executable(TestApp TestApp.cpp)
|
|
target_link_libraries(TestApp LibCore)
|
|
target_link_libraries(TestApp LibCore)
|
|
@@ -766,4 +804,6 @@ endif()
|
|
|
|
|
|
if (ENABLE_FUZZERS)
|
|
if (ENABLE_FUZZERS)
|
|
add_subdirectory(Fuzzers)
|
|
add_subdirectory(Fuzzers)
|
|
|
|
+else()
|
|
|
|
+ export_components("${CMAKE_BINARY_DIR}/components.ini")
|
|
endif()
|
|
endif()
|