Skip to content

Commit 00cdb9e

Browse files
jmschonfeldiCharlesHu
authored andcommitted
Make CoreFoundation a public module and install its headers
1 parent 5ee7cdc commit 00cdb9e

File tree

97 files changed

+123
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+123
-106
lines changed

Sources/CoreFoundation/CMakeLists.txt

+25-8
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
##===----------------------------------------------------------------------===##
1414

1515
file(GLOB_RECURSE _CoreFoundationSources "*.c")
16-
add_library(_CoreFoundation STATIC ${_CoreFoundationSources})
16+
add_library(CoreFoundation STATIC ${_CoreFoundationSources})
1717

18-
target_include_directories(_CoreFoundation
18+
target_include_directories(CoreFoundation
1919
PUBLIC
2020
include
2121
PRIVATE
@@ -28,13 +28,30 @@ list(APPEND _CoreFoundation_build_flags
2828
"-DCF_CHARACTERSET_UNICHAR_DB=\"${CMAKE_SOURCE_DIR}/Sources/CoreFoundation/CFUniCharPropertyDatabase.data\""
2929
"-DCF_CHARACTERSET_BITMAP=\"${CMAKE_SOURCE_DIR}/Sources/CoreFoundation/CFCharacterSetBitmaps.bitmap\"")
3030

31-
target_compile_options(_CoreFoundation PRIVATE
31+
target_compile_options(CoreFoundation PRIVATE
3232
"SHELL:$<$<COMPILE_LANGUAGE:C>:${_CoreFoundation_build_flags}>")
3333

34-
target_precompile_headers(_CoreFoundation PRIVATE internalInclude/CoreFoundation_Prefix.h)
34+
target_precompile_headers(CoreFoundation PRIVATE internalInclude/CoreFoundation_Prefix.h)
3535

36-
target_link_libraries(_CoreFoundation PUBLIC
37-
FoundationICU)
38-
39-
target_link_libraries(_CoreFoundation PRIVATE
36+
target_link_libraries(CoreFoundation PRIVATE
37+
FoundationICU
4038
dispatch)
39+
40+
file(COPY
41+
"include/module.map"
42+
DESTINATION
43+
${CMAKE_BINARY_DIR}/CoreFoundationHeaders
44+
NO_SOURCE_PERMISSIONS)
45+
46+
47+
file(GLOB_RECURSE _CoreFoundationPublicHeaders "include/*.h")
48+
file(COPY
49+
${_CoreFoundationPublicHeaders}
50+
DESTINATION
51+
${CMAKE_BINARY_DIR}/CoreFoundationHeaders
52+
NO_SOURCE_PERMISSIONS)
53+
54+
install(DIRECTORY
55+
${CMAKE_BINARY_DIR}/CoreFoundationHeaders/
56+
DESTINATION
57+
lib/swift/CoreFoundation)
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module _CoreFoundation [extern_c] [system] {
1+
module CoreFoundation [extern_c] [system] {
22
umbrella header "CoreFoundation.h"
33
explicit module CFPlugInCOM { header "CFPlugInCOM.h" }
44
}

Sources/CoreFoundation/include/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module _CoreFoundation {
1+
module CoreFoundation {
22
umbrella header "CoreFoundation.h"
33
explicit module CFPlugInCOM { header "CFPlugInCOM.h" }
44

Sources/Foundation/Bridging.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import _CoreFoundation
13+
@_implementationOnly import CoreFoundation
1414

1515
#if canImport(ObjectiveC)
1616
import ObjectiveC

Sources/Foundation/Bundle.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
@_silgen_name("swift_getTypeContextDescriptor")
1313
private func _getTypeContextDescriptor(of cls: AnyClass) -> UnsafeRawPointer

Sources/Foundation/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ target_compile_options(Foundation PRIVATE
1919
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")
2020

2121
target_link_libraries(Foundation PRIVATE
22-
_CoreFoundation
22+
CoreFoundation
2323
FoundationEssentials
2424
FoundationInternationalization)
2525

Sources/Foundation/DateComponents.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import _CoreFoundation
13+
@_implementationOnly import CoreFoundation
1414

1515
extension DateComponents : ReferenceConvertible {
1616
public typealias ReferenceType = NSDateComponents

Sources/Foundation/DateFormatter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111
@_spi(SwiftCorelibsFoundation) import FoundationEssentials
1212

1313
open class DateFormatter : Formatter {

Sources/Foundation/DateInterval.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import _CoreFoundation
13+
@_implementationOnly import CoreFoundation
1414

1515
extension DateInterval : _ObjectiveCBridgeable {
1616
public static func _isBridgedToObjectiveC() -> Bool {

Sources/Foundation/DateIntervalFormatter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
internal let kCFDateIntervalFormatterNoStyle = CFDateIntervalFormatterStyle.noStyle
1313
internal let kCFDateIntervalFormatterShortStyle = CFDateIntervalFormatterStyle.shortStyle

Sources/Foundation/Dictionary.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
extension Dictionary : _ObjectiveCBridgeable {
1313

Sources/Foundation/FileHandle.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111
#if canImport(Dispatch)
1212
import Dispatch
1313
#endif

Sources/Foundation/FileManager+POSIX.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal func &(left: UInt32, right: mode_t) -> mode_t {
1313
}
1414
#endif
1515

16-
@_implementationOnly import _CoreFoundation
16+
@_implementationOnly import CoreFoundation
1717

1818
#if os(WASI)
1919
import WASILibc
@@ -27,7 +27,7 @@ internal var O_TRUNC: Int32 { _getConst_O_TRUNC() }
2727
internal var O_WRONLY: Int32 { _getConst_O_WRONLY() }
2828
#endif
2929

30-
@_implementationOnly import _CoreFoundation
30+
@_implementationOnly import CoreFoundation
3131

3232
extension FileManager {
3333
internal func _mountedVolumeURLs(includingResourceValuesForKeys propertyKeys: [URLResourceKey]?, options: VolumeEnumerationOptions = []) -> [URL]? {

Sources/Foundation/FileManager+Win32.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
#if os(Windows)
1313
import let WinSDK.INVALID_FILE_ATTRIBUTES

Sources/Foundation/FileManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fileprivate let UF_APPEND: Int32 = 1
1515
fileprivate let UF_HIDDEN: Int32 = 1
1616
#endif
1717

18-
@_implementationOnly import _CoreFoundation
18+
@_implementationOnly import CoreFoundation
1919
#if os(Windows)
2020
import CRT
2121
import WinSDK

Sources/Foundation/Host.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111
#if os(Windows)
1212
import WinSDK
1313
#endif

Sources/Foundation/ISO8601DateFormatter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
extension ISO8601DateFormatter {
1313

Sources/Foundation/JSONDecoder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import _CoreFoundation
13+
@_implementationOnly import CoreFoundation
1414

1515
/// A marker protocol used to determine whether a value is a `String`-keyed `Dictionary`
1616
/// containing `Decodable` values (in which case it should be exempt from key conversion strategies).

Sources/Foundation/JSONEncoder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import _CoreFoundation
13+
@_implementationOnly import CoreFoundation
1414

1515
/// A marker protocol used to determine whether a value is a `String`-keyed `Dictionary`
1616
/// containing `Encodable` values (in which case it should be exempt from key conversion strategies).

Sources/Foundation/JSONSerialization.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import _CoreFoundation
13+
@_implementationOnly import CoreFoundation
1414

1515
extension JSONSerialization {
1616
public struct ReadingOptions : OptionSet {

Sources/Foundation/Measurement.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if DEPLOYMENT_RUNTIME_SWIFT
14-
@_implementationOnly import _CoreFoundation
14+
@_implementationOnly import CoreFoundation
1515
#else
1616
@_exported import Foundation // Clang module
1717
import _SwiftCoreFoundationOverlayShims

Sources/Foundation/NSArray.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
open class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCoding, ExpressibleByArrayLiteral {
1313
private let _cfinfo = _CFInfo(typeID: CFArrayGetTypeID())

Sources/Foundation/NSAttributedString.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
extension NSAttributedString {
1313
public struct Key: RawRepresentable, Equatable, Hashable {

Sources/Foundation/NSCFArray.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010

11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313
internal final class _NSCFArray : NSMutableArray {
1414
deinit {

Sources/Foundation/NSCFBoolean.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010

11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313
internal class __NSCFBoolean : NSNumber {
1414
override var hash: Int {

Sources/Foundation/NSCFCharacterSet.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2016 Apple. All rights reserved.
77
//
88

9-
@_implementationOnly import _CoreFoundation
9+
@_implementationOnly import CoreFoundation
1010

1111
internal class _NSCFCharacterSet : NSMutableCharacterSet {
1212

Sources/Foundation/NSCFDictionary.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010

11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313
internal final class _NSCFDictionary : NSMutableDictionary {
1414
deinit {

Sources/Foundation/NSCFSet.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010

11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313
internal final class _NSCFSet : NSMutableSet {
1414
deinit {

Sources/Foundation/NSCFString.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010

11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313
@usableFromInline
1414
internal class _NSCFString : NSMutableString {

Sources/Foundation/NSCalendar.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111
@_spi(SwiftCorelibsFoundation) @_exported import FoundationEssentials
1212

1313
internal let kCFCalendarUnitEra = CFCalendarUnit.era
@@ -23,7 +23,7 @@ internal let kCFCalendarUnitQuarter = CFCalendarUnit.quarter
2323
internal let kCFCalendarUnitWeekOfMonth = CFCalendarUnit.weekOfMonth
2424
internal let kCFCalendarUnitWeekOfYear = CFCalendarUnit.weekOfYear
2525
internal let kCFCalendarUnitYearForWeekOfYear = CFCalendarUnit.yearForWeekOfYear
26-
internal let kCFCalendarUnitNanosecond = CFCalendarUnit(rawValue: CFOptionFlags(_CoreFoundation.kCFCalendarUnitNanosecond))
26+
internal let kCFCalendarUnitNanosecond = CFCalendarUnit(rawValue: CFOptionFlags(CoreFoundation.kCFCalendarUnitNanosecond))
2727

2828
internal func _CFCalendarUnitRawValue(_ unit: CFCalendarUnit) -> CFOptionFlags {
2929
return unit.rawValue

Sources/Foundation/NSCharacterSet.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010

11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313
let kCFCharacterSetControl = CFCharacterSetPredefinedSet.control
1414
let kCFCharacterSetWhitespace = CFCharacterSetPredefinedSet.whitespace

Sources/Foundation/NSConcreteValue.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
internal class NSConcreteValue : NSValue {
1313

Sources/Foundation/NSData.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111
#if !os(WASI)
1212
import Dispatch
1313
#endif

Sources/Foundation/NSDate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
public typealias TimeInterval = Double
1313

Sources/Foundation/NSDateComponents.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010
@_exported import FoundationEssentials
11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313

1414
// This is a just used as an extensible struct, basically;

Sources/Foundation/NSDictionary.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010

11-
@_implementationOnly import _CoreFoundation
11+
@_implementationOnly import CoreFoundation
1212

1313
#if !os(WASI)
1414
import Dispatch

Sources/Foundation/NSError.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Glibc
1818
import CRT
1919
#endif
2020

21-
@_implementationOnly import _CoreFoundation
21+
@_implementationOnly import CoreFoundation
2222

2323
public typealias NSErrorDomain = NSString
2424

Sources/Foundation/NSKeyedArchiver.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
@_implementationOnly import _CoreFoundation
10+
@_implementationOnly import CoreFoundation
1111

1212
/// Archives created using the class method `archivedData(withRootObject:)` use this key
1313
/// for the root object in the hierarchy of encoded objects. The `NSKeyedUnarchiver` class method

0 commit comments

Comments
 (0)