Skip to content

Commit 26d44d5

Browse files
committed
Properly configure the target library name used by magic-symbols-for-install-name.c.
1 parent 998b833 commit 26d44d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,10 +1881,13 @@ function(add_swift_target_library name)
18811881
endforeach()
18821882

18831883
# Add PrivateFrameworks, rdar://28466433
1884+
set(swiftlib_c_compile_flags_all ${SWIFTLIB_C_COMPILE_FLAGS})
18841885
if(sdk IN_LIST SWIFT_APPLE_PLATFORMS AND SWIFTLIB_IS_SDK_OVERLAY)
18851886
set(swiftlib_swift_compile_private_frameworks_flag "-Fsystem" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/System/Library/PrivateFrameworks/")
18861887
endif()
18871888

1889+
list(APPEND swiftlib_c_compile_flags_all "-DSWIFT_TARGET_LIBRARY_NAME=${name}")
1890+
18881891
# Add this library variant.
18891892
_add_swift_library_single(
18901893
${VARIANT_NAME}
@@ -1902,7 +1905,7 @@ function(add_swift_target_library name)
19021905
FRAMEWORK_DEPENDS_WEAK ${SWIFTLIB_FRAMEWORK_DEPENDS_WEAK}
19031906
LLVM_COMPONENT_DEPENDS ${SWIFTLIB_LLVM_COMPONENT_DEPENDS}
19041907
FILE_DEPENDS ${SWIFTLIB_FILE_DEPENDS} ${swiftlib_module_dependency_targets}
1905-
C_COMPILE_FLAGS ${SWIFTLIB_C_COMPILE_FLAGS}
1908+
C_COMPILE_FLAGS ${swiftlib_c_compile_flags_all}
19061909
SWIFT_COMPILE_FLAGS ${swiftlib_swift_compile_flags_all} ${swiftlib_swift_compile_flags_arch} ${swiftlib_swift_compile_private_frameworks_flag}
19071910
LINK_FLAGS ${swiftlib_link_flags_all}
19081911
PRIVATE_LINK_LIBRARIES ${swiftlib_private_link_libraries_targets}

0 commit comments

Comments
 (0)