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

Lines changed: 25 additions & 8 deletions
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)
Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)