Build native macOS applications β including Cocoa and Qt-based GUI apps β entirely on Windows, using Clang, CMake, and Ninja.
β No Mac required to build. Just transfer and run the output on a real Mac.
π±οΈ New: Use the built-in Toolchain GUI to select your macOS SDK, configure deployment targets, and generate CMake projects.
- Build real macOS
.appand CLI binaries from Windows - Full support for C, Objective-C, and Qt (QtWidgets)
- Cocoa GUI support (AppDelegate, XIB-style)
- Works with CMake + Ninja or Visual Studio
- Automatically detects macOS SDK from
SDK/folder - Includes working examples: CLI, Cocoa, and Qt GUI
- No VM or Hackintosh required
This project provides a cross-compilation toolchain that allows you to build native macOS executables β including GUI apps β from a Windows system. It supports:
- Clang + macOS SDK
- Objective-C, C, and C++ (Qt)
- Cocoa GUI (with AppDelegate)
- Qt Widgets-based GUI
MacCross/
βββ CMakeLists.txt
βββ SDK/
β βββ MacOSX14.5.sdk/ # <--- Place SDK here
βββ C-Example/
β βββ hello.c
βββ ObjC-Example/
β βββ main.m
β βββ AppDelegate.h
β βββ AppDelegate.m
βββ Qt-Example/
β βββ main.cpp
βββ macosx-toolchain.cmake
βββ build-Qt.bat # Optional manual script
βββ build/
- LLVM/Clang for Windows
- Ninja build system
- CMake (v3.10+)
- macOS SDK (place in
SDK/folder) - QtMacos-SDK
- Qt Example on GitHub
You can build using either CMake + Ninja (CLI) or Visual Studio (GUI). Both methods work with this project.
mkdir build
cd build
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=../macosx-toolchain.cmake ..
cmake --build .- Open Visual Studio
- Select "Open a local folder"
- Choose the project root (where
CMakeLists.txtis located) - When prompted, select a CMake configuration (e.g.,
x64-Release) - Visual Studio will detect the CMake project and automatically configure it
- Ensure
macosx-toolchain.cmakeis being used:- Go to CMake Settings or
CMakePresets.json - Set the toolchain file path under
CMake toolchain file
- Go to CMake Settings or
- Build via Build > Build All
β Make sure the toolchain file is set, or builds will fail.
If you're using Qt (especially static builds), set the following environment variables before building:
set QT_DIR=F:\Qt\6.7.3\macos
set QT_FRAMEWORKS=%QT_DIR%\libβ MACOSX_SDK_PATH and MACOSX_DEPLOYMENT_TARGET are automatically handled by the toolchain (SDK is detected from the SDK/ folder, deployment target is set to 11.0 by default).
Transfer the built binaries to a Mac and run:
./hello # From C-Example
./ObjCExample # From Cocoa app
./QtExample # From Qt appExpected output:
Hello, world!
β οΈ Note: Binaries are unsigned. You may need to bypass Gatekeeper to run them.
- β CLI C Hello World
- β Cocoa GUI App (Objective-C + AppDelegate)
- β Qt Widgets GUI App
Want Swift support? Coming soon.
- Image to ICNS: Convert PNG or JPEG images to macOS
.icnsfiles on Windows.
This project is licensed under the MIT License (with a non-commercial use clause).
See the LICENSE file for more details.
If you found this project helpful, please open an issue with suggestions or improvements.
Contributions are welcome β feel free to submit a pull request!