Skip to content

Commit ee4fc83

Browse files
committed
build: allow building in Debug mode on Windows
With this tweak, we should be able to build the package in debug mode even on Windows. We always use the release mode DLL form of the C/C++ runtime on Windows and can build the Swift code in Debug or Release mode optimizations.
1 parent 8732961 commit ee4fc83

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
2+
if(POLICY CMP0091)
3+
cmake_policy(SET CMP0091 NEW)
4+
endif()
5+
16
cmake_minimum_required(VERSION 3.19)
27

38
project(SwiftTSC LANGUAGES C Swift)
49

510
set(CMAKE_Swift_LANGUAGE_VERSION 5)
611
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
12+
# TODO: lift this restriction once we have a split Swift runtime build which can
13+
# be built with a debug C runtime.
14+
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
715

16+
# TODO: lift this restriction once we have a split Swift runtime build which can
17+
# be built with a debug C runtime.
18+
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
819
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
920
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
1021
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

0 commit comments

Comments
 (0)