summaryrefslogtreecommitdiffstats
path: root/Tests/SwiftOnly
diff options
context:
space:
mode:
authorDave Abrahams <dabrahams@adobe.com>2024-05-16 00:05:10 (GMT)
committerDave Abrahams <dabrahams@adobe.com>2024-05-16 20:54:36 (GMT)
commitacfcce7e1b2b596581d16e0162974058b8e1ab93 (patch)
tree508cd58dfc64eefe6fe9ff209f38181a6eb15165 /Tests/SwiftOnly
parent96028ad95c21029a261d49de5a788f385e18c380 (diff)
downloadCMake-acfcce7e1b2b596581d16e0162974058b8e1ab93.zip
CMake-acfcce7e1b2b596581d16e0162974058b8e1ab93.tar.gz
CMake-acfcce7e1b2b596581d16e0162974058b8e1ab93.tar.bz2
Swift: test that CMAKE_Swift_MODULE_DIRECTORY is respected.
Diffstat (limited to 'Tests/SwiftOnly')
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index de4c82f..25892f1 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -43,6 +43,17 @@ add_library(N N.swift)
target_link_libraries(N PUBLIC
M)
+# FIXME(#25989): The Xcode generator doesn't respect CMAKE_Swift_MODULE_DIRECTORY.
+if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ add_custom_command(TARGET M
+ POST_BUILD
+ COMMAND "${CMAKE_COMMAND}" -E compare_files
+ "${CMAKE_Swift_MODULE_DIRECTORY}/M.swiftmodule"
+ "${CMAKE_Swift_MODULE_DIRECTORY}/M.swiftmodule"
+ COMMENT "check that .swiftmodule files are generated in CMAKE_Swift_MODULE_DIRECTORY"
+ VERBATIM)
+endif()
+
if(NOT XCODE_VERSION OR XCODE_VERSION VERSION_GREATER_EQUAL 9.0)
# TODO: Add a wholemodule object-library test once that is working
add_library(O OBJECT O.swift L.swift)