Swift: WIN32_EXECUTABLE property is not supported
I am trying out CMake 3.16.0rc1 with a Swift project.
I have a cross-platform project (Mac, Windows, Linux, iOS, Android) that uses ADD_EXECUTABLE(${USER_EXECUTABLE_TARGET} MACOSX_BUNDLE WIN32 ... ) In prior versions, this worked for me, but when I build for iOS (using one of the iOS toolchains floating around), the WIN32 parameter now gives me a hard error:
WIN32_EXECUTABLE property is not supported on Swift executables Call Stack (most recent call first): CMakeLists.txt:28 (INCLUDE)
So I have several problems with this:
-
The WIN32 flag should be completely ignored on non-Windows systems. (It is ignored for Mac, but not iOS, so maybe the toolchain I use needs something added? If so, I would really appreciate it if you would tell me.)
-
I think the WIN32 flag should be respected with Swift/Windows. In my original experiments, I used SDL as my foundation for a Swift app, and SDL (in C) defines WinMain. I have done some other things similar with non-SDL projects to get GUI based apps working with Swift. At the very least, it is unclear to my why CMake makes a distinction for this flag, especially when C/C++ files can co-exist/inter-mix with Swift files in a single project.
-
At the very least, I feel this should be a warning instead of a hard error while Swift on Windows is still heavily evolving.