summaryrefslogtreecommitdiffstats
path: root/Tests/SwiftMixPCH/CMakeLists.txt
blob: d5704f12fd679721020b76489b5cd59f3a7acda2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cmake_minimum_required(VERSION 3.15)
if(POLICY CMP0157)
  cmake_policy(SET CMP0157 NEW)
endif()

project(SwiftMixPCH C Swift)

# Swift on Windows only provides a release runtime.
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)

add_executable(SwiftMixPCH CMain.c SwiftFunc.swift)
target_precompile_headers(SwiftMixPCH PRIVATE pch.h)

# We don't want swift to emit main()
target_compile_options(SwiftMixPCH PRIVATE "$<$<COMPILE_LANGUAGE:Swift>:-parse-as-library>")