Skip to content

Commit

Permalink
Meta: Exclude LibCore, LibUnicode, and LibURL from the lagom-tools build
Browse files Browse the repository at this point in the history
We only need LibCoreMinimal for the lagom-tools build. In particular, by
removing LibUnicode, we remove the lagom-tools dependence on the system
ICU package, as we do not have vcpkg hooked into this build. (We could
probably add vcpkg here, but since this libraries aren't even needed, we
don't need to bother).

(cherry picked from commit c9d9e1bb1f968165940f60d6b4b6ea0e32d1a027;
amended to fix conflicts due to cmake lists being pretty different,
in part to to us not having LadybirdBrowser/ladybird#105)
  • Loading branch information
trflynn89 authored and nico committed Oct 16, 2024
1 parent a4e4214 commit 312710e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
32 changes: 17 additions & 15 deletions Meta/Lagom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,26 +380,12 @@ if (Backtrace_FOUND AND NOT "${Backtrace_LIBRARIES}" STREQUAL "")
target_include_directories(AK PRIVATE ${Backtrace_INCLUDE_DIRS})
endif()

add_serenity_subdirectory(Userland/Libraries/LibUnicode)
add_serenity_subdirectory(Userland/Libraries/LibURL)

# LibCore
# LibCoreMinimal
add_serenity_subdirectory(Userland/Libraries/LibCore)
target_link_libraries(LibCore PRIVATE Threads::Threads)
if (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
# NetBSD has its shm_open and shm_unlink functions in librt so we need to link that
target_link_libraries(LibCore PRIVATE rt)
target_link_libraries(LibCoreMinimal PRIVATE rt)
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# Solaris has socket and networking related functions in two extra libraries
target_link_libraries(LibCore PRIVATE nsl socket)
endif()
if (HAIKU)
# Haiku has networking related functions in the network library
target_link_libraries(LibCore PRIVATE network)
endif()
target_link_libraries(LibCore PRIVATE LibURL)

# LibMain
add_serenity_subdirectory(Userland/Libraries/LibMain)
Expand Down Expand Up @@ -508,11 +494,27 @@ if (BUILD_LAGOM)
TextCodec
Threading
TLS
Unicode
URL
Wasm
WebSocket
XML
)

target_link_libraries(LibCore PRIVATE LibURL Threads::Threads)
if (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
# NetBSD has its shm_open and shm_unlink functions in librt so we need to link that
target_link_libraries(LibCore PRIVATE rt)
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# Solaris has socket and networking related functions in two extra libraries
target_link_libraries(LibCore PRIVATE nsl socket)
endif()
if (HAIKU)
# Haiku has networking related functions in the network library
target_link_libraries(LibCore PRIVATE network)
endif()

# These are needed for both LibWeb and LibProtocol.
compile_ipc(${SERENITY_PROJECT_ROOT}/Userland/Services/RequestServer/RequestClient.ipc Userland/Services/RequestServer/RequestClientEndpoint.h)
compile_ipc(${SERENITY_PROJECT_ROOT}/Userland/Services/RequestServer/RequestServer.ipc Userland/Services/RequestServer/RequestServerEndpoint.h)
Expand Down
4 changes: 4 additions & 0 deletions Userland/Libraries/LibCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ set(SOURCES
serenity_lib(LibCoreMinimal coreminimal)
target_link_libraries(LibCoreMinimal PRIVATE LibSystem)

if (NOT BUILD_LAGOM AND NOT SERENITYOS)
return()
endif()

if (SERENITYOS)
add_library(DynamicLoader_LibCoreArgsParser
ArgsParser.cpp
Expand Down

0 comments on commit 312710e

Please sign in to comment.