Skip to content

Commit

Permalink
CMake: fix separate overlay builds
Browse files Browse the repository at this point in the history
When building overlay separately, look for dylibs in the overlay
build directory first, and only then fall back to the compiler resource
directory.

If the overlay changes the ABI, we shouldn't even try the dylibs in the
compiler resource directory, that is certain to fail the build or
result in miscompiles.

rdar://22866170

Swift SVN r32382
  • Loading branch information
gribozavr committed Oct 1, 2015
1 parent f90f9a6 commit 0c1b6f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ function(_add_swift_library_single target name)
set_property(TARGET "${target}" APPEND_STRING PROPERTY
COMPILE_FLAGS " ${c_compile_flags}")
set_property(TARGET "${target}" APPEND_STRING PROPERTY
LINK_FLAGS " ${link_flags} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR} -L${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}")
LINK_FLAGS " ${link_flags} -L${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
target_link_libraries("${target}" PRIVATE
${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})
if(${SWIFTLIB_SINGLE_INTERFACE_LINK_LIBRARIES})
Expand All @@ -1101,7 +1101,7 @@ function(_add_swift_library_single target name)
set_property(TARGET "${target_static}" APPEND_STRING PROPERTY
COMPILE_FLAGS " ${c_compile_flags}")
set_property(TARGET "${target_static}" APPEND_STRING PROPERTY
LINK_FLAGS " ${link_flags} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR} -L${SWIFTSTATICLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}")
LINK_FLAGS " ${link_flags} -L${SWIFTSTATICLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR} -L${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
target_link_libraries("${target_static}" PRIVATE
${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})
endif()
Expand Down

0 comments on commit 0c1b6f8

Please sign in to comment.