diff options
author | Brad King <brad.king@kitware.com> | 2024-01-22 15:56:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-01-24 19:44:40 (GMT) |
commit | b2129a14f47a92dfb0c662882885d335b98811d7 (patch) | |
tree | 5663313a657003368003ffb065b86fd0a8db5f6d /Tests | |
parent | 4f49f7fc0bcfd22fd1870334694afd022dbebfd4 (diff) | |
download | CMake-b2129a14f47a92dfb0c662882885d335b98811d7.zip CMake-b2129a14f47a92dfb0c662882885d335b98811d7.tar.gz CMake-b2129a14f47a92dfb0c662882885d335b98811d7.tar.bz2 |
Tests: Fix SwiftMix tests' runtime library selection on Windows
Swift on Windows provides only a release runtime.
Use it for C and CXX too, in all configurations, to match.
Issue: #25573
Suggested-by: Saleem Abdulrasool <compnerd@compnerd.org>
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/SwiftMix/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/SwiftMixLib/CMakeLists.txt | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Tests/SwiftMix/CMakeLists.txt b/Tests/SwiftMix/CMakeLists.txt index e8b6521..a4bb19b 100644 --- a/Tests/SwiftMix/CMakeLists.txt +++ b/Tests/SwiftMix/CMakeLists.txt @@ -1,6 +1,9 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.15) project(SwiftMix C Swift) +# Swift on Windows only provides a release runtime. +set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL) + add_executable(SwiftMix CMain.c ObjCMain.m SwiftMain.swift ObjC-Swift.h) set_property(TARGET SwiftMix PROPERTY XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER "ObjC-Swift.h") target_compile_options(SwiftMix PRIVATE "$<$<COMPILE_LANGUAGE:C>:-Werror=objc-method-access>") diff --git a/Tests/SwiftMixLib/CMakeLists.txt b/Tests/SwiftMixLib/CMakeLists.txt index a52fc94..d23c6ba 100644 --- a/Tests/SwiftMixLib/CMakeLists.txt +++ b/Tests/SwiftMixLib/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.24) project(SwiftMixLib C CXX Swift) +# Swift on Windows only provides a release runtime. +set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL) + add_library(SwiftMixedLib lib.c lib.cpp lib.swift) add_executable(Swifty main.swift) target_link_libraries(Swifty PUBLIC SwiftMixedLib) |