Skip to content

Commit 1c0abe7

Browse files
authored
Merge pull request swiftlang#815 from al45tair/musl-support-main
Changes for Musl compatibility
2 parents 5529d35 + 3b2e9ea commit 1c0abe7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,15 @@ add_compile_definitions($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:HA
314314

315315

316316
if(ENABLE_SWIFT)
317-
set(INSTALL_TARGET_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>" CACHE PATH "Path where the libraries will be installed")
317+
if(NOT SWIFT_SYSTEM_NAME)
318+
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
319+
set(SWIFT_SYSTEM_NAME macosx)
320+
else()
321+
set(SWIFT_SYSTEM_NAME "$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>")
322+
endif()
323+
endif()
324+
325+
set(INSTALL_TARGET_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/${SWIFT_SYSTEM_NAME}" CACHE PATH "Path where the libraries will be installed")
318326
set(INSTALL_DISPATCH_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/dispatch" CACHE PATH "Path where the headers will be installed for libdispatch")
319327
set(INSTALL_BLOCK_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/Block" CACHE PATH "Path where the headers will be installed for the blocks runtime")
320328
set(INSTALL_OS_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/os" CACHE PATH "Path where the os/ headers will be installed")

tests/dispatch_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#if __has_include(<sys/event.h>)
3434
#define HAS_SYS_EVENT_H 1
3535
#include <sys/event.h>
36+
#elif __has_include(<poll.h>)
37+
#include <poll.h>
3638
#else
3739
#include <sys/poll.h>
3840
#endif

0 commit comments

Comments
 (0)