Skip to content

Commit

Permalink
build: adjust the build for rebranch (#4820)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
compnerd committed Sep 18, 2023
1 parent 1319097 commit f07fa9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ target_compile_definitions(Foundation PRIVATE
DEPLOYMENT_RUNTIME_SWIFT)
target_compile_options(Foundation PUBLIC
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
"SHELL:-Xfrontend -disable-autolink-framework -Xfrontend CoreFoundation"
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
target_link_libraries(Foundation
PRIVATE
Expand Down
1 change: 1 addition & 0 deletions Sources/FoundationNetworking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ target_compile_options(FoundationNetworking PUBLIC
# forced load symbol when validating the TBD
-Xfrontend -validate-tbd-against-ir=none
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
"SHELL:-Xfrontend -disable-autolink-framework -Xfrontend CFURLSessionInterface"
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
target_link_libraries(FoundationNetworking
PRIVATE
Expand Down
1 change: 1 addition & 0 deletions Sources/FoundationXML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ target_compile_definitions(FoundationXML PRIVATE
DEPLOYMENT_RUNTIME_SWIFT)
target_compile_options(FoundationXML PUBLIC
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
"SHELL:-Xfrontend -disable-autolink-framework -Xfrontend CFXMLInterface"
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
target_link_libraries(FoundationXML
PRIVATE
Expand Down

0 comments on commit f07fa9f

Please sign in to comment.