Skip to content

Commit 4bee0d3

Browse files
committed
Extract extension and compile only for non-freestanding
1 parent 1537342 commit 4bee0d3

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ if(SWIFT_STDLIB_ENABLE_VECTOR_TYPES)
260260
list(APPEND SWIFTLIB_EMBEDDED_GYB_SOURCES SIMDConcreteOperations.swift.gyb SIMDVectorTypes.swift.gyb)
261261
endif()
262262

263+
if(NOT SWIFT_FREESTANDING_FLAVOR)
264+
list(APPEND SWIFTLIB_SOURCES ObjectIdentifier+DebugDescription.swift)
265+
endif()
266+
263267
list(APPEND SWIFTLIB_EMBEDDED_SOURCES
264268
EmbeddedRuntime.swift
265269
EmbeddedStubs.swift
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2017 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+
//===----------------------------------------------------------------------===//
12+
13+
#if !$Embedded
14+
@_DebugDescription
15+
extension ObjectIdentifier {
16+
var _debugDescription: String {
17+
return "ObjectIdentifier(\(_value))"
18+
}
19+
}
20+
#endif

stdlib/public/core/ObjectIdentifier.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ extension ObjectIdentifier: CustomDebugStringConvertible {
9494
}
9595
}
9696

97-
#if !$Embedded
98-
@_DebugDescription
99-
extension ObjectIdentifier {
100-
var _debugDescription: String {
101-
return "ObjectIdentifier(\(_value))"
102-
}
103-
}
104-
#endif
105-
10697
extension ObjectIdentifier: Equatable {
10798
@inlinable // trivial-implementation
10899
public static func == (x: ObjectIdentifier, y: ObjectIdentifier) -> Bool {

utils/swift_build_support/swift_build_support/products/minimalstdlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def build(self, host_target):
9393
'SWIFT_BUILD_STATIC_SDK_OVERLAY:BOOL', 'FALSE')
9494
self.cmake_options.define('SWIFT_BUILD_STATIC_STDLIB:BOOL', 'TRUE')
9595
self.cmake_options.define('SWIFT_INCLUDE_TESTS:BOOL', 'TRUE')
96-
self.cmake_options.define('SWIFT_INCLUDE_TOOLS:BOOL', 'TRUE')
96+
self.cmake_options.define('SWIFT_INCLUDE_TOOLS:BOOL', 'FALSE')
9797

9898
# Stdlib feature flags
9999
self.cmake_options.define('SWIFT_ENABLE_BACKTRACING:BOOL', 'FALSE')

0 commit comments

Comments
 (0)