Skip to content

plotfi/swift-win32

 
 

Repository files navigation

Swift/Win32 - A Swift Application Framework for Windows

Swift/Win32 Screenshot

Swift/Win32 aims to provide a MVC model for writing applications on Windows. It provides Swift friendly wrapping of the Win32 APIs much like MFC did for C++.

Build Requirements

  • Latest Swift Snapshot (11/08 or later)
  • Windows SDK 10.0.107763 or newer
  • CMake 3.16 or newer

Building

This project requires the latest Swift snapshot (November 08, 2020 or newer). You can use the the snapshot binaries from swift.org or download the nightly build from Azure.

Recommended (CMake)

The following example session shows how to build with CMake 3.16 or newer.

cmake -B build -D BUILD_SHARED_LIBS=YES -D CMAKE_BUILD_TYPE=Release -D CMAKE_Swift_FLAGS="-sdk %SDKROOT%" -G Ninja -S .
ninja -C build SwiftWin32 UICatalog

%CD%\build\bin\UICatalog.exe

Swift Package Manager

Building this project with swift-package-manager is supported although CMake is recommended for ease. The Swift Package Manager based build is required for code completion via SourceKit-LSP. It also allows for the use of Swift/Win32 in other applications using SPM. In order to use SPM to build this project additional post-build steps are required to use the demo applications.

The following known limitations are known:

  1. It is not possible to deploy auxiliary files which are required for Swift/Win32 based applications to function to the correct location.
  2. It is not possible to build and run multiple demo projects as the auxiliary files collide.
swift build --product UICatalog
copy Examples\UICatalog\UICatalog.exe.manifest .build\x86_64-unknown-windows-msvc\debug\
copy Examples\UICatalog\Info.plist .build\x86_64-unknown-windows-msvc\debug\
swift run UICatalog

About

A Win32 application framework for Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 92.9%
  • CMake 4.8%
  • C 2.1%
  • C++ 0.2%