Skip to content

Commit 9023bf5

Browse files
committed
CoreFoundation: remove private headers from public directory
Clean up the long standing issue with private headers being pushed into the public headers directory. Add a private modulemap so that we can still access the private headers.
1 parent 7dba88d commit 9023bf5

File tree

3 files changed

+13
-35
lines changed

3 files changed

+13
-35
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
framework module CoreFoundation_Private [extern_c] [system] {
2+
umbrella header "ForSwitFoundationOnly.h"
3+
export *
4+
module * {
5+
export *
6+
}
7+
}
8+

CoreFoundation/CMakeLists.txt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ add_framework(CoreFoundation
5555
CoreFoundation_FRAMEWORK_DIRECTORY
5656
MODULE_MAP
5757
Base.subproj/module.modulemap
58+
Base.subproj/module.private.modulemap
5859
PRIVATE_HEADERS
5960
# Base
6061
Base.subproj/CFAsmMacros.h
6162
Base.subproj/CFInternal.h
6263
Base.subproj/CFKnownLocations.h
64+
Base.subproj/CFLocking.h
6365
Base.subproj/CFLogUtilities.h
6466
Base.subproj/CFPriv.h
6567
Base.subproj/CFOverflow.h
@@ -124,30 +126,6 @@ add_framework(CoreFoundation
124126
URL.subproj/CFURLPriv.h
125127
URL.subproj/CFURLSessionInterface.h
126128
PUBLIC_HEADERS
127-
# FIXME: PrivateHeaders referenced by public headers
128-
Base.subproj/CFKnownLocations.h
129-
Base.subproj/CFLocking.h
130-
Base.subproj/CFLogUtilities.h
131-
Base.subproj/CFPriv.h
132-
Base.subproj/CFRuntime.h
133-
Base.subproj/ForFoundationOnly.h
134-
Base.subproj/ForSwiftFoundationOnly.h
135-
Locale.subproj/CFCalendar_Internal.h
136-
Locale.subproj/CFDateComponents.h
137-
Locale.subproj/CFDateInterval.h
138-
Locale.subproj/CFLocaleInternal.h
139-
Parsing.subproj/CFXMLInterface.h
140-
PlugIn.subproj/CFBundlePriv.h
141-
Stream.subproj/CFStreamPriv.h
142-
String.subproj/CFCharacterSetPriv.h
143-
String.subproj/CFRegularExpression.h
144-
String.subproj/CFRunArray.h
145-
StringEncodings.subproj/CFStringEncodingConverter.h
146-
StringEncodings.subproj/CFStringEncodingConverterExt.h
147-
URL.subproj/CFURLPriv.h
148-
URL.subproj/CFURLSessionInterface.h
149-
Locale.subproj/CFDateIntervalFormatter.h
150-
151129
# AppServices
152130
AppServices.subproj/CFNotificationCenter.h
153131
AppServices.subproj/CFUserNotification.h

CoreFoundation/cmake/modules/CoreFoundationAddFramework.cmake

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ include(CMakeParseArguments)
33

44
function(add_framework NAME)
55
set(options STATIC SHARED)
6-
set(single_value_args MODULE_MAP FRAMEWORK_DIRECTORY)
7-
set(multiple_value_args PRIVATE_HEADERS PUBLIC_HEADERS SOURCES)
6+
set(single_value_args FRAMEWORK_DIRECTORY)
7+
set(multiple_value_args MODULE_MAP PRIVATE_HEADERS PUBLIC_HEADERS SOURCES)
88
cmake_parse_arguments(AF "${options}" "${single_value_args}" "${multiple_value_args}" ${ARGN})
99

1010
set(AF_TYPE)
@@ -52,17 +52,9 @@ function(add_framework NAME)
5252
PROPERTIES
5353
LIBRARY_OUTPUT_DIRECTORY
5454
${CMAKE_BINARY_DIR}/${NAME}.framework)
55-
if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
56-
target_compile_options(${NAME}
57-
PRIVATE
58-
-Xclang;-F${CMAKE_BINARY_DIR})
59-
else()
60-
target_compile_options(${NAME}
61-
PRIVATE
62-
-F;${CMAKE_BINARY_DIR})
63-
endif()
6455
target_compile_options(${NAME}
6556
PRIVATE
57+
$<$<STREQUAL:${CMAKE_C_SIMULATE_ID},MSVC>:/clang:>-F${CMAKE_BINARY_DIR}
6658
$<$<OR:$<COMPILE_LANGUAGE:ASM>,$<COMPILE_LANGUAGE:C>>:-I;${CMAKE_BINARY_DIR}/${NAME}.framework/PrivateHeaders>)
6759
add_dependencies(${NAME} ${NAME}_POPULATE_HEADERS)
6860

0 commit comments

Comments
 (0)