Skip to content

Commit 03a00ed

Browse files
committed
cmake fix.
1 parent 632f127 commit 03a00ed

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ set_property(GLOBAL PROPERTY JOB_POOL_LINK local_jobs)
1414
# First include general CMake utilities.
1515
include(SwiftUtils)
1616
include(CheckSymbolExists)
17+
include(CheckIncludeFiles)
18+
19+
check_include_files("xpc/xpc.h" HAVE_XPC_H)
1720

1821
#
1922
# User-configurable options that control the inclusion and default build
@@ -393,6 +396,12 @@ option(SWIFT_ENABLE_SOURCEKIT_TESTS
393396
"Enable running SourceKit tests"
394397
${SWIFT_BUILD_SOURCEKIT_default})
395398

399+
if(HAVE_XPC_H AND SWIFT_BUILD_SOURCEKIT)
400+
set(BUILD_SOURCEKIT_FRAMEWORK TRUE)
401+
else()
402+
set(BUILD_SOURCEKIT_FRAMEWORK FALSE)
403+
endif()
404+
396405
#
397406
# Assume a new enough ar to generate the index at construction time. This avoids
398407
# having to invoke ranlib as a secondary command.

tools/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ add_swift_tool_subdirectory(swift-api-digester)
1616
add_swift_tool_subdirectory(swift-syntax-test)
1717
add_swift_tool_subdirectory(swift-refactor)
1818

19+
if(SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY)
20+
set(BUILD_FOUNDATION TRUE)
21+
else()
22+
set(BUILD_FOUNDATION FALSE)
23+
endif()
24+
1925
if(SWIFT_BUILD_SOURCEKIT)
2026
add_swift_tool_subdirectory(SourceKit)
21-
if(BUILD_SOURCEKIT_FRAMEWORK AND SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY)
27+
if(BUILD_SOURCEKIT_FRAMEWORK AND BUILD_FOUNDATION)
2228
set(BUILD_SOURCEKIT_SWIFT_CLIENT TRUE)
2329
else()
2430
set(BUILD_SOURCEKIT_SWIFT_CLIENT FALSE)
@@ -35,7 +41,7 @@ if(SWIFT_HOST_VARIANT STREQUAL "macosx")
3541
# SwiftSyntax depends on both the standard library (because it's a
3642
# Swift module), and the SDK overlays (because it depends on Foundation).
3743
# Ensure we only build SwiftSyntax when we're building both.
38-
if(SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY)
44+
if(BUILD_FOUNDATION)
3945
add_subdirectory(SwiftSyntax)
4046
endif()
4147
endif()
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
add_subdirectory(InProc)
2-
if (HAVE_XPC_H)
3-
set(BUILD_SOURCEKIT_FRAMEWORK TRUE)
2+
if(BUILD_SOURCEKIT_FRAMEWORK)
43
add_subdirectory(XPC)
5-
else()
6-
set(BUILD_SOURCEKIT_FRAMEWORK FALSE)
74
endif()

tools/SourceKit/tools/sourcekitd/lib/API/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
include(CheckIncludeFiles)
2-
3-
check_include_files("xpc/xpc.h" HAVE_XPC_H)
4-
51
# If we were going to build for APPLE but don't have XPC, just build inproc.
62
if(APPLE AND NOT HAVE_XPC_H)
73
set(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY TRUE)

0 commit comments

Comments
 (0)