summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeSwiftInformation.cmake
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-05-24 16:32:05 (GMT)
committerSaleem Abdulrasool <compnerd@compnerd.org>2019-05-24 17:33:25 (GMT)
commitabea06efdfebbf5becfde40cb8ecc8427054edf1 (patch)
tree079385f26c09720c45c3c1a7399b85293566e722 /Modules/CMakeSwiftInformation.cmake
parent4ec2b999414495ae58871755307ea17f391f7910 (diff)
downloadCMake-abea06efdfebbf5becfde40cb8ecc8427054edf1.zip
CMake-abea06efdfebbf5becfde40cb8ecc8427054edf1.tar.gz
CMake-abea06efdfebbf5becfde40cb8ecc8427054edf1.tar.bz2
Modules: setup `CMAKE_Swift_LINKER_PREFERENCE`
Swift's driver will invoke the C++ driver (`clang++`) to invoke the linker. Additionally, it will configure the command line to deal with the linkage runtime support object (`swiftrt.o` or `swiftrt.obj`) to be added at the right time (similar to C/C++). Since it indirects through `clang++` it will properly setup the linker invocation for C++ and C as well. This should permit the correct linker driver to be invoked in multi-language projects. Closes #19299
Diffstat (limited to 'Modules/CMakeSwiftInformation.cmake')
-rw-r--r--Modules/CMakeSwiftInformation.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 2bba178..6bc4bbe 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -23,6 +23,9 @@ set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ")
set(CMAKE_Swift_COMPILER_ARG1 -frontend)
set(CMAKE_Swift_FRAMEWORK_SEARCH_FLAG "-F ")
+set(CMAKE_Swift_LINKER_PREFERENCE 50)
+set(CMAKE_Swift_LINKER_PREFERENCE_PROPAGATES 1)
+
# NOTE(compnerd) use the short form for convenience and ease of search. They
# are treated equivalent to their long form names as well as custom Swift
# specific names.