Skip to content

Commit f07fa9f

Browse files
authored
build: adjust the build for rebranch (#4820)
The newer clang compiler prefers `module.modulemap` over `module.map`. This will result in us using the framework form of the module definitions for CoreFoundation. While this is fine for the compilation, the linker directive to link against the framework will also be emitted into the object files. This causes a linker failure on Windows as `-framework (CoreFoundation|CFURLInterface|CFXMLInterface)` is not a valid linker option. Use the swift control over the directives to avoid emitting the framework link directive to repair the build.
1 parent 1319097 commit f07fa9f

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

Sources/Foundation/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ target_compile_definitions(Foundation PRIVATE
152152
DEPLOYMENT_RUNTIME_SWIFT)
153153
target_compile_options(Foundation PUBLIC
154154
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
155+
"SHELL:-Xfrontend -disable-autolink-framework -Xfrontend CoreFoundation"
155156
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
156157
target_link_libraries(Foundation
157158
PRIVATE

Sources/FoundationNetworking/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ target_compile_options(FoundationNetworking PUBLIC
5959
# forced load symbol when validating the TBD
6060
-Xfrontend -validate-tbd-against-ir=none
6161
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
62+
"SHELL:-Xfrontend -disable-autolink-framework -Xfrontend CFURLSessionInterface"
6263
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
6364
target_link_libraries(FoundationNetworking
6465
PRIVATE

Sources/FoundationXML/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ target_compile_definitions(FoundationXML PRIVATE
1010
DEPLOYMENT_RUNTIME_SWIFT)
1111
target_compile_options(FoundationXML PUBLIC
1212
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
13+
"SHELL:-Xfrontend -disable-autolink-framework -Xfrontend CFXMLInterface"
1314
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
1415
target_link_libraries(FoundationXML
1516
PRIVATE

0 commit comments

Comments
 (0)