Skip to content

Commit ab03d2b

Browse files
authored
Merge pull request #590 from nkcsgexi/oss-setup
cmake: set up build-script support for swift-build-sdk-interfaces
2 parents 903ae6a + efa22f7 commit ab03d2b

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

Sources/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ add_subdirectory(CSwiftScan)
1010
add_subdirectory(SwiftOptions)
1111
add_subdirectory(SwiftDriver)
1212
add_subdirectory(SwiftDriverExecution)
13+
add_subdirectory(swift-build-sdk-interfaces)
1314
add_subdirectory(swift-driver)
1415
add_subdirectory(swift-help)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This source file is part of the Swift.org open source project
2+
#
3+
# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See http://swift.org/LICENSE.txt for license information
7+
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
9+
add_executable(swift-build-sdk-interfaces
10+
main.swift)
11+
target_link_libraries(swift-build-sdk-interfaces PUBLIC
12+
SwiftDriver
13+
SwiftDriverExecution)

Sources/swift-build-sdk-interfaces/main.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
//===--------------- main.swift - swift-build-sdk-interfaces ------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
112
import SwiftDriverExecution
213
import SwiftDriver
314
import TSCLibc

Utilities/build-script-helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def error(message):
2727
driver_toolchain_tools = ['swift', 'swift-frontend', 'clang', 'swift-help',
2828
'swift-autolink-extract', 'lldb']
2929

30+
executables_to_install = ['swift-driver', 'swift-help', 'swift-build-sdk-interfaces']
31+
3032
def mkdir_p(path):
3133
"""Create the given directory, if it does not exist."""
3234
try:
@@ -211,7 +213,7 @@ def handle_invocation(args):
211213
# TODO: Unify CMake-based installation flow used on Darwin with this
212214
def non_darwin_install(swiftpm_bin_path, toolchain, verbose):
213215
toolchain_bin = os.path.join(toolchain, 'bin')
214-
for exe in ['swift-driver', 'swift-help']:
216+
for exe in executables_to_install:
215217
install_binary(exe, swiftpm_bin_path, toolchain_bin, verbose)
216218

217219
def install(args, build_dir, targets):
@@ -250,7 +252,7 @@ def install_swiftdriver(args, build_dir, prefix, targets) :
250252
# Install universal binaries for swift-driver and swift-help into the toolchain bin
251253
# directory
252254
def install_executables(args, build_dir, universal_bin_dir, toolchain_bin_dir, targets):
253-
for exe in ['swift-driver', 'swift-help']:
255+
for exe in executables_to_install:
254256
# Fixup rpaths
255257
for target in targets:
256258
exe_bin_path = os.path.join(build_dir, target,

0 commit comments

Comments
 (0)