From 16051481f8d05cdfdcea430305efb7f6722fbfa9 Mon Sep 17 00:00:00 2001 From: Eric Miotto <1094986+edymtt@users.noreply.github.com> Date: Tue, 28 Jan 2020 07:38:02 -0800 Subject: [PATCH] [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 #29451) -- this way no undesired side effects are introduced should a new search path be added. Addresses rdar://problem/58934566 --- cmake/modules/AddSwift.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake index bfd27d2722dbc..a2c743437aa5f 100644 --- a/cmake/modules/AddSwift.cmake +++ b/cmake/modules/AddSwift.cmake @@ -163,9 +163,12 @@ function(_add_variant_c_compile_link_flags) endif() if(IS_DARWIN) + # We collate -F with the framework path to avoid unwanted deduplication + # of options by target_compile_options -- this way no undesired + # side effects are introduced should a new search path be added. list(APPEND result "-arch" "${CFLAGS_ARCH}" - "-F" "${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks") + "-F${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks") set(add_explicit_version TRUE) @@ -422,8 +425,11 @@ function(_add_variant_swift_compile_flags endif() if(IS_DARWIN) + # We collate -F with the framework path to avoid unwanted deduplication + # of options by target_compile_options -- this way no undesired + # side effects are introduced should a new search path be added. list(APPEND result - "-F" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/../../../Developer/Library/Frameworks") + "-F${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/../../../Developer/Library/Frameworks") endif() is_build_type_optimized("${build_type}" optimized)