mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 20:00:51 -05:00
c0dd3dd2c1
Xcode has a separate setting for Swift compile definitions, so we can compute a dedicated value for it. Therefore we can: * Support the COMPILE_LANGUAGE generator expression for Swift-specific filters. * Avoid passing the `=value` part of definitions, which Swift does not support. This revises commit5cb625eb2f(Xcode: Pass compile definitions to Swift, 2022-06-19, v3.25.0-rc1~493^2) and reverts commit12c6fec6b4(Xcode: Drop CMAKE_INTDIR= definition in Swift targets, 2022-09-30, v3.25.0-rc1~60^2~2), as the latter is no longer needed. Fixes: #24086
8 lines
435 B
CMake
8 lines
435 B
CMake
cmake_minimum_required(VERSION 3.3)
|
|
project(SwiftMix C Swift)
|
|
|
|
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>")
|
|
target_compile_definitions(SwiftMix PRIVATE "$<IF:$<COMPILE_LANGUAGE:Swift>,SWIFTCOND,CCOND=2>" FOO BAR=3)
|