Skip to content

Commit 993610f

Browse files
committed
Introduced a suite of xcconfig files for the PlaygroundLogger and PlaygroundSupport Xcode projects.
This is to centralize some build settings, including build settings related to the install path and runpath search paths. As part of this, removed build setting overrides which are now redundant.
1 parent 5b20ed4 commit 993610f

File tree

7 files changed

+309
-176
lines changed

7 files changed

+309
-176
lines changed

PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj

Lines changed: 54 additions & 98 deletions
Large diffs are not rendered by default.

PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj

Lines changed: 40 additions & 78 deletions
Large diffs are not rendered by default.

XcodeConfig/Common.xcconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//===--- Common.xcconfig --------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#include "Packaging.xcconfig"
14+
15+
// Enable Clang modules.
16+
CLANG_ENABLE_MODULES = YES
17+
18+
// Set the macOS, iOS, and tvOS deployment targets to reasonable values.
19+
MACOSX_DEPLOYMENT_TARGET = 10.11
20+
IPHONEOS_DEPLOYMENT_TARGET = 10.0
21+
TVOS_DEPLOYMENT_TARGET = 10.0
22+
23+
// Prefer to use the default toolchain when building (unless an overriding toolchain has been provided, in which case this build setting override will effectively be ignored).
24+
TOOLCHAINS = default

XcodeConfig/Debug.xcconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//===--- Debug.xcconfig ---------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#include "Common.xcconfig"
14+
15+
// Only build the active architecture when building for Debug.
16+
ONLY_ACTIVE_ARCH = YES
17+
18+
// Enable testability when building for Debug.
19+
ENABLE_TESTABILITY = YES
20+
21+
// Compile Swift code at -Onone in Debug.
22+
SWIFT_OPTIMIZATION_LEVEL = -Onone
23+
24+
// Compile C/Objective-C/C++ code at -O0 in Debug.
25+
GCC_OPTIMIZATION_LEVEL = 0

XcodeConfig/Packaging.xcconfig

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//===--- Packaging.xcconfig -----------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2018 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
//
13+
// This file provides build settings which support packaging the products
14+
// delivered in swift-xcode-playground-support.
15+
//
16+
// Although there's only a single kind of supported package at this time,
17+
// this provides an easy-to-extend mechanism by which other packaging schemes
18+
// can be added.
19+
//
20+
// Packages should provide the following build settings:
21+
//
22+
// - PGS_<package name>_FRAMEWORKS_DIR_FOR_INSTALL
23+
// - PGS_<package name>_PRIVATEFRAMEWORKS_DIR_FOR_INSTALL
24+
// - PGS_<package name>_SHALLOW_FRAMEWORK_RUNPATH_SEARCH_PATHS
25+
// - PGS_<package name>_VERSIONED_FRAMEWORK_RUNPATH_SEARCH_PATHS
26+
// - PGS_<package name>_SHALLOW_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS
27+
// - PGS_<package name>_VERSIONED_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS
28+
//
29+
// Targets may use the following build settings which abstract over the active
30+
// package in their configuration:
31+
//
32+
// - PGS_FRAMEWORKS_DIR_FOR_INSTALL
33+
// - PGS_PRIVATEFRAMEWORKS_DIR_FOR_INSTALL
34+
// - PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS
35+
// - PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS
36+
//
37+
// Targets should **not** use the PGS_PACKAGE build setting directly.
38+
//
39+
//===----------------------------------------------------------------------===//
40+
41+
// PGS_PACKAGE: The name of the active package. (This is only used in build settings; it is not, by default, exposed anywhere.)
42+
PGS_PACKAGE = XcodeToolchain
43+
44+
// PGS_FRAMEWORKS_DIR_FOR_INSTALL: The Frameworks directory in the current package into which content may be installed.
45+
PGS_FRAMEWORKS_DIR_FOR_INSTALL = $(PGS_$(PGS_PACKAGE)_FRAMEWORKS_DIR_FOR_INSTALL)
46+
47+
// PGS_PRIVATEFRAMEWORKS_DIR_FOR_INSTALL: The PrivateFrameworks directory in the current package into which content may be installed.
48+
PGS_PRIVATEFRAMEWORKS_DIR_FOR_INSTALL = $(PGS_$(PGS_PACKAGE)_PRIVATEFRAMEWORKS_DIR_FOR_INSTALL)
49+
50+
// PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS: The runpath search paths for frameworks installed in the Frameworks directory in the current package.
51+
PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS = $(PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS_$(SHALLOW_BUNDLE))
52+
PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS_YES = $(PGS_$(PGS_PACKAGE)_SHALLOW_FRAMEWORK_RUNPATH_SEARCH_PATHS)
53+
PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS_NO = $(PGS_$(PGS_PACKAGE)_VERSIONED_FRAMEWORK_RUNPATH_SEARCH_PATHS)
54+
PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS_ = $(PGS_FRAMEWORK_RUNPATH_SEARCH_PATHS_NO)
55+
56+
// PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS: The runpath search paths for frameworks installed in the PrivateFrameworks directory in the current package.
57+
PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS = $(PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS_$(SHALLOW_BUNDLE))
58+
PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS_YES = $(PGS_$(PGS_PACKAGE)_SHALLOW_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS)
59+
PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS_NO = $(PGS_$(PGS_PACKAGE)_VERSIONED_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS)
60+
PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS_ = $(PGS_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS_NO)
61+
62+
// Include support for the XcodeToolchain package.
63+
#include "XcodeToolchainPackage.xcconfig"

XcodeConfig/Release.xcconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===--- Release.xcconfig -------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#include "Common.xcconfig"
14+
15+
// Compile Swift code at -O with WMO enabled in Release.
16+
SWIFT_OPTIMIZATION_LEVEL = -Owholemodule
17+
18+
// Compile C/Objective-C/C++ code at -Os in Release.
19+
GCC_OPTIMIZATION_LEVEL = s
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
//===--- XcodeToolchainPackage.xcconfig -----------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2018 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
//
13+
// This file contains build settings related to the "XcodeToolchain" package,
14+
// including the appropriate install paths.
15+
//
16+
//===----------------------------------------------------------------------===//
17+
18+
// MARK: - Installation Directories
19+
20+
// TOOLCHAIN_INSTALL_DIR_IS_EMPTY: YES if the TOOLCHAIN_INSTALL_DIR build setting is empty; NO otherwise
21+
TOOLCHAIN_INSTALL_DIR_IS_EMPTY = $(TOOLCHAIN_INSTALL_DIR_IS_EMPTY_$(TOOLCHAIN_INSTALL_DIR_IS_EMPTY_IMPL))
22+
TOOLCHAIN_INSTALL_DIR_IS_EMPTY_YES = YES
23+
TOOLCHAIN_INSTALL_DIR_IS_EMPTY_NO = NO
24+
TOOLCHAIN_INSTALL_DIR_IS_EMPTY_ = NO
25+
26+
TOOLCHAIN_INSTALL_DIR_IS_EMPTY_IMPL = $(TOOLCHAIN_INSTALL_DIR_IS_EMPTY_IMPL_$(TOOLCHAIN_INSTALL_DIR))
27+
TOOLCHAIN_INSTALL_DIR_IS_EMPTY_IMPL_ = YES
28+
29+
// DT_TOOLCHAIN_DIR_IS_EMPTY: YES if the DT_TOOLCHAIN_DIR build setting is empty; NO otherwise
30+
DT_TOOLCHAIN_DIR_IS_EMPTY = $(DT_TOOLCHAIN_DIR_IS_EMPTY_$(DT_TOOLCHAIN_DIR_IS_EMPTY_IMPL))
31+
DT_TOOLCHAIN_DIR_IS_EMPTY_YES = YES
32+
DT_TOOLCHAIN_DIR_IS_EMPTY_NO = NO
33+
DT_TOOLCHAIN_DIR_IS_EMPTY_ = NO
34+
35+
DT_TOOLCHAIN_DIR_IS_EMPTY_IMPL = $(DT_TOOLCHAIN_DIR_IS_EMPTY_IMPL_$(DT_TOOLCHAIN_DIR))
36+
DT_TOOLCHAIN_DIR_IS_EMPTY_IMPL_ = YES
37+
38+
// PGS_XCTOOLCHAIN_DIR: the path to the xctoolchain into which content should be installed.
39+
// Set to TOOLCHAIN_INSTALL_DIR if non-empty, falling back to DT_TOOLCHAIN_DIR or a hard-coded path otherwise.
40+
PGS_XCTOOLCHAIN_DIR = $(PGS_XCTOOLCHAIN_DIR_$(TOOLCHAIN_INSTALL_DIR_IS_EMPTY))
41+
PGS_XCTOOLCHAIN_DIR_NO = $(TOOLCHAIN_INSTALL_DIR)
42+
PGS_XCTOOLCHAIN_DIR_YES = $(PGS_XCTOOLCHAIN_DIR_YES_$(DT_TOOLCHAIN_DIR_IS_EMPTY))
43+
PGS_XCTOOLCHAIN_DIR_YES_NO = $(DT_TOOLCHAIN_DIR)
44+
PGS_XCTOOLCHAIN_DIR_YES_YES = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
45+
46+
// PGS_XCTOOLCHAIN_DEVELOPER_DIR: the path to the Developer directory inside of the xctoolchain into which content should be installed.
47+
PGS_XCTOOLCHAIN_DEVELOPER_DIR = $(PGS_XCTOOLCHAIN_DIR)/Developer
48+
49+
// PGS_XCTOOLCHAIN_PLATFORM_DIR: the path to the per-platform directory inside of the xctoolchain into which content should be installed.
50+
PGS_XCTOOLCHAIN_PLATFORM_DIR = $(PGS_XCTOOLCHAIN_DEVELOPER_DIR)/Platforms/$(PGS_PLATFORM_DIR_NAME)
51+
52+
// PGS_PLATFORM_DIR_NAME: The name of the .platform directory for a given PLATFORM_NAME.
53+
PGS_PLATFORM_DIR_NAME = $(PGS_PLATFORM_DIR_NAME_$(PLATFORM_NAME))
54+
PGS_PLATFORM_DIR_NAME_macosx = MacOSX.platform
55+
PGS_PLATFORM_DIR_NAME_iphoneos = iPhoneOS.platform
56+
PGS_PLATFORM_DIR_NAME_iphonesimulator = iPhoneSimulator.platform
57+
PGS_PLATFORM_DIR_NAME_appletvos = AppleTVOS.platform
58+
PGS_PLATFORM_DIR_NAME_appletvsimulator = AppleTVSimulator.platform
59+
PGS_PLATFORM_DIR_NAME_watchos = WatchOS.platform
60+
PGS_PLATFORM_DIR_NAME_watchsimulator = WatchSimulator.platform
61+
62+
// PGS_XCTOOLCHAIN_PLATFORM_LIBRARY_DIR: the per-platform Developer directory inside of the xctoolchain into which content may be installed.
63+
PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_DIR = $(PGS_XCTOOLCHAIN_PLATFORM_DIR)/Developer
64+
65+
// PGS_XCTOOLCHAIN_PLATFORM_LIBRARY_DIR: the per-platform Developer/Library directory inside of the xctoolchain into which content may be installed.
66+
PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_LIBRARY_DIR = $(PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_DIR)/Library
67+
68+
// PGS_XCTOOLCHAIN_PLATFORM_FRAMEWORKS_DIR: the per-platform directory inside of the xctoolchain into which content should be installed for public frameworks.
69+
PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_FRAMEWORKS_DIR = $(PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_LIBRARY_DIR)/Frameworks
70+
71+
// PGS_XCTOOLCHAIN_PLATFORM_PRIVATEFRAMEWORKS_DIR: the per-platform directory inside of the xctoolchain into which content should be installed for private frameworks.
72+
PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_PRIVATEFRAMEWORKS_DIR = $(PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_LIBRARY_DIR)/PrivateFrameworks
73+
74+
// Install Frameworks and PrivateFrameworks into the per-platform directory in the toolchain.
75+
PGS_XcodeToolchain_FRAMEWORKS_DIR_FOR_INSTALL = $(PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_FRAMEWORKS_DIR)
76+
PGS_XcodeToolchain_PRIVATEFRAMEWORKS_DIR_FOR_INSTALL = $(PGS_XCTOOLCHAIN_PLATFORM_DEVELOPER_PRIVATEFRAMEWORKS_DIR)
77+
78+
// MARK: Runpath Search Paths
79+
80+
PGS_XcodeToolchain_SHALLOW_FRAMEWORK_RUNPATH_SEARCH_PATHS = @loader_path/../ @loader_path/../../PrivateFrameworks/ @loader_path/../../../../../../../usr/lib/swift/$(PLATFORM_NAME)/
81+
PGS_XcodeToolchain_SHALLOW_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS = @loader_path/../ @loader_path/../../Frameworks/ @loader_path/../../../../../../../usr/lib/swift/$(PLATFORM_NAME)/
82+
83+
PGS_XcodeToolchain_VERSIONED_FRAMEWORK_RUNPATH_SEARCH_PATHS = @loader_path/../../../ @loader_path/../../../../PrivateFrameworks/ @loader_path/../../../../../../../../../usr/lib/swift/$(PLATFORM_NAME)/
84+
PGS_XcodeToolchain_VERSIONED_PRIVATE_FRAMEWORK_RUNPATH_SEARCH_PATHS = @loader_path/../../../ @loader_path/../../../../Frameworks/ @loader_path/../../../../../../../../../usr/lib/swift/$(PLATFORM_NAME)/

0 commit comments

Comments
 (0)