summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-16 12:15:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-12-16 12:15:41 (GMT)
commitba41ca758af655d320d9bc2ca52d4c15c6f25b50 (patch)
tree4ce1fa5f25be2107f06de42fbec1502caa27c600 /Tests
parent316bb67ff74e89a87e50370d809429f122689e3d (diff)
parent9bed4f4d817f139f0c2e050d7420e1e247949fe4 (diff)
downloadCMake-ba41ca758af655d320d9bc2ca52d4c15c6f25b50.zip
CMake-ba41ca758af655d320d9bc2ca52d4c15c6f25b50.tar.gz
CMake-ba41ca758af655d320d9bc2ca52d4c15c6f25b50.tar.bz2
Merge topic 'swift-split-compilation-model'
9bed4f4d81 Swift/Ninja: Split compilation model 64b3367845 cmGlobalGenerator: Allow passing language to GetLangaugeOutputExtension Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8907
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt6
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt24
-rw-r--r--Tests/SwiftOnly/O.swift0
3 files changed, 19 insertions, 11 deletions
diff --git a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
index bb08a49..d644d6b 100644
--- a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
+++ b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
@@ -1,3 +1,3 @@
-.*Linking Swift static library libA.a
-.*Linking Swift static library libB.a
-FAILED: libB.a CMakeFiles/B.dir/b.swift.o B.swiftmodule
+.*Building Swift object A.swiftmodule CMakeFiles/A.dir/a.swift.o
+.*Building Swift object B.swiftmodule CMakeFiles/B.dir/b.swift.o
+FAILED: B.swiftmodule CMakeFiles/B.dir/b.swift.o
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index 7de1e04..2aa5710 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -43,6 +43,13 @@ add_library(N N.swift)
target_link_libraries(N PUBLIC
M)
+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)
+ target_link_libraries(N PUBLIC O)
+ set_target_properties(O PROPERTIES Swift_COMPILATION_MODE "incremental")
+endif()
+
# Dummy to make sure generation works with such targets.
add_library(SwiftIface INTERFACE)
target_link_libraries(SwiftOnly PRIVATE SwiftIface)
@@ -59,14 +66,15 @@ if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.2)
endif()
function(test_cmp0157_default mode)
-
- cmake_policy(GET CMP0157 cmp0157_wmo)
- if(cmp0157_wmo STREQUAL "NEW")
- set(CMAKE_Swift_COMPILATION_MODE "${mode}")
- add_executable(hi_${mode} main.swift)
- get_target_property(${mode}_swift_comp_mode hi_${mode} "Swift_COMPILATION_MODE")
- if(NOT ${mode}_swift_comp_mode STREQUAL ${mode})
- message(SEND_ERROR "expected ${mode} -- found ${${mode}_swift_comp_mode}")
+ if(POLICY CMP0157)
+ cmake_policy(GET CMP0157 cmp0157_wmo)
+ if(cmp0157_wmo STREQUAL "NEW")
+ set(CMAKE_Swift_COMPILATION_MODE "${mode}")
+ add_executable(hi_${mode} main.swift)
+ get_target_property(${mode}_swift_comp_mode hi_${mode} "Swift_COMPILATION_MODE")
+ if(NOT ${mode}_swift_comp_mode STREQUAL ${mode})
+ message(SEND_ERROR "expected ${mode} -- found ${${mode}_swift_comp_mode}")
+ endif()
endif()
endif()
endfunction()
diff --git a/Tests/SwiftOnly/O.swift b/Tests/SwiftOnly/O.swift
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/SwiftOnly/O.swift