Skip to content

Commit 5428060

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

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

@@ -405,8 +408,11 @@ function(_add_variant_swift_compile_flags
405408
endif()
406409

407410
if(IS_DARWIN)
411+
# We collate -F with the framework path to avoid unwanted deduplication
412+
# of options by target_compile_options -- this way no undesired
413+
# side effects are introduced should a new search path be added.
408414
list(APPEND result
409-
"-F" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/../../../Developer/Library/Frameworks")
415+
"-F${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/../../../Developer/Library/Frameworks")
410416
endif()
411417

412418
is_build_type_optimized("${build_type}" optimized)

0 commit comments

Comments
 (0)