2 set(WITH_APPLE_PTHREAD_SOURCE "" CACHE PATH "Path to Apple's libpthread")
3 set(WITH_APPLE_LIBPLATFORM_SOURCE "" CACHE PATH "Path to Apple's libplatform")
4 set(WITH_APPLE_LIBCLOSURE_SOURCE "" CACHE PATH "Path to Apple's libclosure")
5 set(WITH_APPLE_XNU_SOURCE "" CACHE PATH "Path to Apple's XNU")
6 set(WITH_APPLE_OBJC4_SOURCE "" CACHE PATH "Path to Apple's ObjC4")
8 if(WITH_APPLE_PTHREAD_SOURCE)
9 include_directories(SYSTEM "${WITH_APPLE_PTHREAD_SOURCE}")
11 if(WITH_APPLE_LIBPLATFORM_SOURCE)
12 include_directories(SYSTEM "${WITH_APPLE_LIBPLATFORM_SOURCE}/include")
14 if(WITH_APPLE_LIBCLOSURE_SOURCE)
15 include_directories(SYSTEM "${WITH_APPLE_LIBCLOSURE_SOURCE}")
17 if(WITH_APPLE_XNU_SOURCE)
18 # FIXME(compnerd) this should use -idirafter
19 include_directories("${WITH_APPLE_XNU_SOURCE}/libkern")
20 include_directories(SYSTEM
21 "${WITH_APPLE_XNU_SOURCE}/bsd"
22 "${WITH_APPLE_XNU_SOURCE}/libsyscall"
23 "${WITH_APPLE_XNU_SOURCE}/libsyscall/wrappers/libproc")
25 # hack for xnu/bsd/sys/event.h EVFILT_SOCK declaration
26 add_definitions(-DPRIVATE=1)
29 if(IS_DIRECTORY "/System/Library/Frameworks/System.framework/PrivateHeaders")
30 include_directories(SYSTEM
31 "/System/Library/Frameworks/System.framework/PrivateHeaders")
34 option(ENABLE_APPLE_TSD_OPTIMIZATIONS "use non-portable pthread TSD optimizations" OFF)
35 if(ENABLE_APPLE_TSD_OPTIMIZATIONS)
36 set(USE_APPLE_TSD_OPTIMIZATIONS 1)
38 set(USE_APPLE_TSD_OPTIMIZATIONS 0)
41 # TODO(compnerd) link in libpthread headers