summaryrefslogtreecommitdiff
path: root/Modules/CMakeSwiftInformation.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-20 14:35:49 +0000
committerKitware Robot <kwrobot@kitware.com>2023-01-20 09:36:00 -0500
commit1d52007564f114a158e9f1612a39e6b33ca37934 (patch)
tree8c0d131227934d651219b4b869bfb5ee5b8d0840 /Modules/CMakeSwiftInformation.cmake
parent8150831dfdc445316256c8acdbcf9fd29bced58d (diff)
parent4165eb3d0b21601977b26e8f8af5193c55169cee (diff)
downloadcmake-1d52007564f114a158e9f1612a39e6b33ca37934.tar.gz
Merge topic 'ninja-swift-exported-executables'
4165eb3d0b Ninja: Emit swiftmodule from executable with exports Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8048
Diffstat (limited to 'Modules/CMakeSwiftInformation.cmake')
-rw-r--r--Modules/CMakeSwiftInformation.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 64c7519454..a75dfceea1 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -17,8 +17,6 @@ if(CMAKE_Swift_COMPILER_ID)
include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL)
endif()
-set(CMAKE_EXE_EXPORTS_Swift_FLAG "-emit-module -emit-module-path <SWIFT_MODULE> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS}")
-
set(CMAKE_INCLUDE_FLAG_Swift "-I ")
# FIXME: Move compiler- and platform-specific flags to the above-included modules.
@@ -117,6 +115,10 @@ if(NOT CMAKE_Swift_LINK_EXECUTABLE)
set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
endif()
+if(NOT CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS)
+ set(CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS "${CMAKE_Swift_LINK_EXECUTABLE} -emit-module -emit-module-path <SWIFT_MODULE> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS}")
+endif()
+
if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
set(CMAKE_Swift_CREATE_STATIC_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")