{"id":13732495,"url":"https://github.com/compnerd/swift-win32","last_synced_at":"2025-05-14T19:05:58.785Z","repository":{"id":38050922,"uuid":"171382756","full_name":"compnerd/swift-win32","owner":"compnerd","description":"A Windows application framework for Swift","archived":false,"fork":false,"pushed_at":"2024-11-29T02:59:42.000Z","size":1465,"stargazers_count":1141,"open_issues_count":24,"forks_count":72,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-04-14T22:09:08.378Z","etag":null,"topics":["swift","swift-windows","systems","ui","win32","windows"],"latest_commit_sha":null,"homepage":"https://compnerd.github.io/swift-win32/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compnerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-19T01:25:40.000Z","updated_at":"2025-04-08T17:18:43.000Z","dependencies_parsed_at":"2024-12-08T17:03:10.889Z","dependency_job_id":"cacaba42-85b0-47fe-a013-3ad204856069","html_url":"https://github.com/compnerd/swift-win32","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compnerd%2Fswift-win32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compnerd%2Fswift-win32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compnerd%2Fswift-win32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compnerd%2Fswift-win32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compnerd","download_url":"https://codeload.github.com/compnerd/swift-win32/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968914,"owners_count":21191162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["swift","swift-windows","systems","ui","win32","windows"],"created_at":"2024-08-03T02:01:59.390Z","updated_at":"2025-04-14T22:09:14.402Z","avatar_url":"https://github.com/compnerd.png","language":"Swift","readme":"Swift/Win32 - A Swift Application Framework for Windows\n-------------------------------------------------------\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Swift/Win32 Screenshot\" src=\"Documentation/Images/screenshot.png\" width=\"299\" height=\"588\"/\u003e\n\u003c/p\u003e\n\nSwift/Win32 aims to provide a [MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) model for writing applications on Windows.  It provides Swift friendly wrapping of the Win32 APIs much like [MFC](https://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library) did for C++.\n\n## Build Requirements\n\n- Swift 5.4 or newer\n- Windows SDK 10.0.107763 or newer\n- CMake 3.16 or newer\n\n## Building\n\nThis project requires Swift 5.4 or newer. You can use the the snapshot binaries from [swift.org](https://swift.org/download/), download the nightly build from [Azure](https://dev.azure.com/compnerd/swift-build), or build the Swift compiler from source.\n\n### Recommended (CMake)\n\nThe following example session shows how to build with CMake 3.16 or newer.\n\n```cmd\ncmake -B build -D BUILD_SHARED_LIBS=YES -D CMAKE_BUILD_TYPE=Release -D CMAKE_Swift_FLAGS=\"-sdk %SDKROOT%\" -G Ninja -S .\nninja -C build SwiftWin32 UICatalog\n\n%CD%\\build\\bin\\UICatalog.exe\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eRequired Environment Variables\u003c/summary\u003e\n\n  The CMake build will automatically perform the application manifest merging via the `mt` tool, which is part of the Visual Studio build tools.  Ensure that you run the build under the `x64 Native Tools Command Prompt for VS2019` (or the appropriate shell for the version of Visual Studio).\n\n  The Swift installer will also add environment variables, ensure that you have restarted the terminal emulator after installing the toolchain to pick up the required environment variables.\n\u003c/details\u003e\n\n### Swift Package Manager\n\nBuilding 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.\n\nThe following known limitations are known:\n\n1. It is not possible to deploy auxiliary files which are required for Swift/Win32 based applications to function to the correct location.\n2. It is not possible to build and run multiple demo projects as the auxiliary files collide.\n\n```cmd\nswift build --product UICatalog\nmt -nologo -manifest Examples\\UICatalog\\UICatalog.exe.manifest -outputresource:.build\\x86_64-unknown-windows-msvc\\debug\\UICatalog.exe\ncopy Examples\\UICatalog\\Info.plist .build\\x86_64-unknown-windows-msvc\\debug\\\n.build\\x86_64-unknown-windows-msvc\\debug\\UICatalog.exe\n```\n\nIn order to get access to the manifest tool (`mt`), the build and testing should occur in a [x64 Native Tools Command Prompt for VS2019](https://docs.microsoft.com/en-us/cpp/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line?view=msvc-160)\n\n## Testing\n\nThe current implementation is still under flux and many of the interfaces we expect to be present are not yet implemented.  Because clearly indicating the missing surface makes it easier to focus on what needs to be accomplished, there are many instances of interfaces being declared but not implemented.  Most of these sites will abort if they are reached.  In order to enable testing for scenarios which may interct with these cases, a special condition has been added as `ENABLE_TESTING` to allow us to bypass the missing functionality.\n\nYou can run tests by adding that as a flag when invoking the SPM test command as:\n\n```cmd\nswift test -Xswiftc -DENABLE_TESTING\n```\n","funding_links":[],"categories":["Windows","Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompnerd%2Fswift-win32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompnerd%2Fswift-win32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompnerd%2Fswift-win32/lists"}