Skip to content

Commit 00c384a

Browse files
committed
Merge pull request #256 from dgrove-oss/libdispatch-build-plumbing
Next step in connecting libdispatch and foundation builds
2 parents d735dea + fc9f4b4 commit 00c384a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CoreFoundation/Base.subproj/CFBase.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
#define __HAS_DISPATCH__ 1
6262
#endif
6363
#endif
64+
#if DEPLOYMENT_TARGET_LINUX && DEPLOYMENT_RUNTIME_SWIFT && DEPLOYMENT_ENABLE_LIBDISPATCH
65+
#define __HAS_DISPATCH__ 1
66+
#endif
67+
6468
// Some compilers provide the capability to test if certain features are available. This macro provides a compatibility path for other compilers.
6569
#ifndef __has_feature
6670
#define __has_feature(x) 0

build.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@
6060
'-L${XCTEST_BUILD_DIR}',
6161
'-I/usr/include/libxml2'
6262
]
63+
64+
if "LIBDISPATCH_SOURCE_DIR" in Configuration.current.variables:
65+
foundation.CFLAGS += " "+" ".join([
66+
'-DDEPLOYMENT_ENABLE_LIBDISPATCH',
67+
'-I'+Configuration.current.variables["LIBDISPATCH_SOURCE_DIR"],
68+
'-I'+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+'/tests' # for include of dispatch/private.h in CF
69+
])
70+
6371
foundation.SWIFTCFLAGS = " ".join(swift_cflags)
6472

6573
foundation.LDFLAGS += '-lpthread -ldl -lm -lswiftCore -lxml2 '

0 commit comments

Comments
 (0)