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
.app
and 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.txt
is 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.cmake
is 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 app
Expected 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
.icns
files 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!