Skip to content

[pull] master from apple:master #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2506,6 +2506,9 @@ function(_add_swift_executable_single name)
if(SWIFTEXE_SINGLE_EXCLUDE_FROM_ALL)
message(SEND_ERROR "${name} is using EXCLUDE_FROM_ALL option which is deprecated.")
endif()
if(SWIFTEXE_SINGLE_LINK_LIBRARIES)
message(SEND_ERROR "${name} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
endif()

# Check arguments.
precondition(SWIFTEXE_SINGLE_SDK MESSAGE "Should specify an SDK")
Expand Down Expand Up @@ -2540,12 +2543,6 @@ function(_add_swift_executable_single name)
LINK_LIBRARIES_VAR_NAME link_libraries
LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories)

_list_add_string_suffix(
"${SWIFTEXE_SINGLE_LINK_LIBRARIES}"
"-${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}-${SWIFTEXE_SINGLE_ARCHITECTURE}"
SWIFTEXE_SINGLE_LINK_LIBRARIES_TARGETS)
set(SWIFTEXE_SINGLE_LINK_LIBRARIES ${SWIFTEXE_SINGLE_LINK_LIBRARIES_TARGETS})

handle_swift_sources(
dependency_target
unused_module_dependency_target
Expand Down Expand Up @@ -2609,7 +2606,6 @@ function(_add_swift_executable_single name)
BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
LIBRARY_DIR ${SWIFT_LIBRARY_OUTPUT_INTDIR})

target_link_libraries("${name}" PRIVATE ${SWIFTEXE_SINGLE_LINK_LIBRARIES})
swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_LLVM_LINK_COMPONENTS})

# NOTE(compnerd) use the C linker language to invoke `clang` rather than
Expand Down
10 changes: 8 additions & 2 deletions stdlib/cmake/modules/AddSwiftStdlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ function(add_swift_target_executable name)
DEPENDS ${SWIFTEXE_TARGET_DEPENDS_with_suffix}
LLVM_LINK_COMPONENTS ${SWIFTEXE_TARGET_LLVM_LINK_COMPONENTS}
SDK "${sdk}"
ARCHITECTURE "${arch}"
LINK_LIBRARIES ${SWIFTEXE_TARGET_LINK_LIBRARIES})
ARCHITECTURE "${arch}")

_list_add_string_suffix(
"${SWIFTEXE_TARGET_LINK_LIBRARIES}"
"-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}"
SWIFTEXE_TARGET_LINK_LIBRARIES_TARGETS)
target_link_libraries(${VARIANT_NAME} PRIVATE
${SWIFTEXE_TARGET_LINK_LIBRARIES_TARGETS})

if(NOT "${VARIANT_SUFFIX}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SUFFIX}")
# By default, don't build executables for target SDKs to avoid building
Expand Down