File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -70,20 +70,16 @@ include(XCTest)
70
70
71
71
set (CF_DEPLOYMENT_SWIFT YES CACHE BOOL "Build for Swift" FORCE)
72
72
73
- set (CMAKE_THREAD_PREFER_PTHREAD TRUE )
74
- set (THREADS_PREFER_PTHREAD_FLAG OFF )
75
73
if (HAS_LIBDISPATCH_API)
74
+ set (CMAKE_THREAD_PREFER_PTHREAD TRUE )
75
+ set (THREADS_PREFER_PTHREAD_FLAG OFF )
76
+ if (ANDROID)
77
+ set (CMAKE_THREAD_LIBS_INIT "-lc" )
78
+ set (THREADS_HAVE_PTHREAD_ARG FALSE )
79
+ endif ()
76
80
find_package (Threads REQUIRED)
77
81
endif ()
78
82
79
- # CMake's Threads adds '-pthread' flag to the interface link
80
- # libraries, which isn't supported by Swift. This is not enabled
81
- # when building with MSVC, but it trips up the Android build, so
82
- # we need to clear out the threads INTERFACE_LINK_LIBRARIES.
83
- if (CMAKE_SYSTEM_NAME STREQUAL "Android" )
84
- set_property (TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "" )
85
- endif ()
86
-
87
83
set (SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} )
88
84
set (BUILD_SHARED_LIBS NO )
89
85
add_subdirectory (CoreFoundation EXCLUDE_FROM_ALL )
You can’t perform that action at this time.
0 commit comments