Meta: Make pthread and mman available for all libraries on Windows

by default
This commit is contained in:
stasoid 2024-12-18 06:36:28 +05:00 committed by Ali Mohammad Pur
parent 6fd7b9b6b9
commit 15a96e841b
Notes: github-actions[bot] 2024-12-18 04:56:50 +00:00
6 changed files with 10 additions and 28 deletions

View file

@ -22,10 +22,6 @@ serenity_lib(LibCoreMinimal coreminimal)
if (WIN32)
find_path(DIRENT_INCLUDE_DIR dirent.h REQUIRED)
target_include_directories(LibCoreMinimal PRIVATE ${DIRENT_INCLUDE_DIR})
find_package(mman REQUIRED)
target_include_directories(LibCoreMinimal PRIVATE ${MMAN_INCLUDE_DIR})
target_link_libraries(LibCoreMinimal PRIVATE ${MMAN_LIBRARY})
endif()
if (LAGOM_TOOLS_ONLY)
@ -116,11 +112,5 @@ if (ANDROID)
endif()
if (WIN32)
target_include_directories(LibCore PRIVATE ${MMAN_INCLUDE_DIR})
find_package(pthread REQUIRED)
target_include_directories(LibCore PRIVATE ${PTHREAD_INCLUDE_DIR})
target_link_libraries(LibCore PRIVATE ${PTHREAD_LIBRARY})
target_link_libraries(LibCore PRIVATE ws2_32.lib)
endif()

View file

@ -22,9 +22,3 @@ if (ENABLE_SWIFT)
target_link_libraries(LibGC PRIVATE AK)
add_swift_target_properties(LibGC LAGOM_LIBRARIES AK)
endif()
if (WIN32)
find_package(mman REQUIRED)
target_include_directories(LibGC PRIVATE ${MMAN_INCLUDE_DIR})
target_link_libraries(LibGC PRIVATE ${MMAN_LIBRARY})
endif()

View file

@ -12,8 +12,3 @@ set(GENERATED_SOURCES
serenity_lib(LibRequests requests)
target_link_libraries(LibRequests PRIVATE LibCore LibIPC)
if (WIN32)
find_package(pthread REQUIRED)
target_include_directories(LibRequests PRIVATE ${PTHREAD_INCLUDE_DIR})
endif()

View file

@ -14,8 +14,3 @@ serenity_lib(LibTLS tls)
target_link_libraries(LibTLS PRIVATE LibCore LibCrypto LibFileSystem)
include(ca_certificates_data)
if (WIN32)
find_package(pthread REQUIRED)
target_include_directories(LibTLS PRIVATE ${PTHREAD_INCLUDE_DIR})
endif()

View file

@ -7,7 +7,5 @@ serenity_lib(LibThreading threading)
target_link_libraries(LibThreading PRIVATE LibCore)
if (WIN32)
find_package(pthread REQUIRED)
target_include_directories(LibThreading PRIVATE ${PTHREAD_INCLUDE_DIR})
target_link_libraries(LibThreading PUBLIC ${PTHREAD_LIBRARY})
endif()

View file

@ -228,6 +228,16 @@ function(lagom_lib target_name fs_name)
target_link_libraries(${target_name} PRIVATE AK)
endif()
if (WIN32)
find_package(pthread REQUIRED)
target_include_directories(${target_name} PRIVATE ${PTHREAD_INCLUDE_DIR})
target_link_libraries(${target_name} PRIVATE ${PTHREAD_LIBRARY})
find_package(mman REQUIRED)
target_include_directories(${target_name} PRIVATE ${MMAN_INCLUDE_DIR})
target_link_libraries(${target_name} PRIVATE ${MMAN_LIBRARY})
endif()
# FIXME: Clean these up so that we don't need so many include dirs
if (ENABLE_INSTALL_HEADERS)
target_include_directories(${target_name} INTERFACE