CMake/Tests/SwiftOnly/CMakeLists.txt
Brad King 601fe84bd1 Swift: Restore support for enabling with INTERFACE libraries
The check added in commit b06f4c8a74 (Swift: disallow WIN32_EXECUTABLE
properties, 2019-05-31, v3.15.0-rc1~9^2) makes sense only for
executables because the `WIN32_EXECUTABLE` property is defined only for
them.  Running the check on other target types, particularly those that
do not link such as INTERFACE libraries, violates internal assumptions.
In particular, `GetLinkerLanguage` should not be called on such targets.

Fixes: #19528
2019-07-29 15:24:29 -04:00

14 lines
363 B
CMake

cmake_minimum_required(VERSION 3.3)
project(SwiftOnly Swift)
if(NOT XCODE_VERSION VERSION_LESS 10.2)
set(CMAKE_Swift_LANGUAGE_VERSION 5.0)
elseif(NOT XCODE_VERSION VERSION_LESS 8.0)
set(CMAKE_Swift_LANGUAGE_VERSION 3.0)
endif()
add_executable(SwiftOnly main.swift)
# Dummy to make sure generation works with such targets.
add_library(SwiftIface INTERFACE)