Skip to content

Commit 1605148

Browse files
committed
[build][gardening] adjust framework paths
Collate -F with the framework path to avoid unwanted deduplication of options by `target_compile_options` (which is the case after swiftlang#29451) -- this way no undesired side effects are introduced should a new search path be added. Addresses rdar://problem/58934566
1 parent c662a91 commit 1605148

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,12 @@ function(_add_variant_c_compile_link_flags)
163163
endif()
164164

165165
if(IS_DARWIN)
166+
# We collate -F with the framework path to avoid unwanted deduplication
167+
# of options by target_compile_options -- this way no undesired
168+
# side effects are introduced should a new search path be added.
166169
list(APPEND result
167170
"-arch" "${CFLAGS_ARCH}"
168-
"-F" "${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks")
171+
"-F${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks")
169172

170173
set(add_explicit_version TRUE)
171174

@@ -422,8 +425,11 @@ function(_add_variant_swift_compile_flags
422425
endif()
423426

424427
if(IS_DARWIN)
428+
# We collate -F with the framework path to avoid unwanted deduplication
429+
# of options by target_compile_options -- this way no undesired
430+
# side effects are introduced should a new search path be added.
425431
list(APPEND result
426-
"-F" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/../../../Developer/Library/Frameworks")
432+
"-F${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/../../../Developer/Library/Frameworks")
427433
endif()
428434

429435
is_build_type_optimized("${build_type}" optimized)

0 commit comments

Comments
 (0)