CMake: Build LibCore tests in Tests/LibCore not Meta/Lagom

As LibCore was not specified in TEST_DIRECTORIES, the existing
Tests/LibCore subdirectory was not actually included during
configuration.
This commit is contained in:
ayeteadoe 2025-05-13 01:03:07 -07:00 committed by Andrew Kaster
commit 8864b3e9d1
Notes: github-actions[bot] 2025-05-14 08:06:35 +00:00
4 changed files with 45 additions and 178 deletions

View file

@ -29,6 +29,11 @@ if (WIN32)
target_include_directories(LibCoreMinimal PRIVATE ${DIRENT_INCLUDE_DIR})
endif()
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(LibCoreMinimal PRIVATE rt)
endif()
if (LAGOM_TOOLS_ONLY)
return()
endif()
@ -102,9 +107,22 @@ if (APPLE)
endif()
serenity_lib(LibCore core)
target_link_libraries(LibCore PRIVATE LibUnicode LibURL)
target_link_libraries(LibCore PRIVATE LibUnicode LibURL Threads::Threads)
target_link_libraries(LibCore PUBLIC LibCoreMinimal)
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()
if (APPLE)
target_link_libraries(LibCore PUBLIC "-framework CoreFoundation")
target_link_libraries(LibCore PUBLIC "-framework CoreServices")