Skip to content

Commit

Permalink
build: allow building in Debug mode on Windows
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
compnerd committed Dec 7, 2023
1 parent 8732961 commit 35afcbf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@

if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()

cmake_minimum_required(VERSION 3.19)

project(SwiftTSC LANGUAGES C Swift)

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

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

0 comments on commit 35afcbf

Please sign in to comment.