Xcode: Swift targets throw warnings when definitions with values are set (e.g. -DFOO=BAR)
CMakeLists.txt
cmake_minimum_required(VERSION 3.25)
project(cmake_swift_defines)
enable_language(Swift)
add_library(a empty.swift)
target_compile_definitions(a PRIVATE -DFOO=BAR)
empty.swift can be an entirely empty file.
- Run with CMake 3.25rc2 and the Xcode generator.
- Open generated Xcode project and build the lib
- Warning during
Planning
phase of the lib targetwarning: Conditional compilation flags do not have values in Swift; they are either present or absent (rather than 'FOO=BAR') (in target 'a' from project 'cmake_swift_defines')
Caused by the change here: !7388 (merged)
Edited by Brad King