Building Movian on Windows¶
This guide covers building Movian from source on Windows systems.
Prerequisites¶
Required Software¶
- Visual Studio 2019 or later (Community Edition is sufficient)
- Install "Desktop development with C++" workload
-
Include Windows 10 SDK
-
Git for Windows
-
Download from git-scm.com
-
CMake (3.15 or later)
- Download from cmake.org
-
Add to PATH during installation
-
Python 3.7+
- Download from python.org
- Add to PATH during installation
Optional Tools¶
- Ninja Build System (recommended for faster builds)
- Download from ninja-build.org
- Add to PATH
Build Steps¶
1. Clone the Repository¶
2. Install Dependencies¶
Movian uses vcpkg for dependency management on Windows:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg integrate install
Install required libraries:
vcpkg install openssl:x64-windows
vcpkg install curl:x64-windows
vcpkg install sqlite3:x64-windows
vcpkg install freetype:x64-windows
3. Configure Build¶
Using Visual Studio:
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A x64 ^
-DCMAKE_TOOLCHAIN_FILE=path\to\vcpkg\scripts\buildsystems\vcpkg.cmake
Using Ninja (faster):
mkdir build
cd build
cmake .. -G Ninja ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_TOOLCHAIN_FILE=path\to\vcpkg\scripts\buildsystems\vcpkg.cmake
4. Build¶
Visual Studio:
Ninja:
5. Run Movian¶
Build Configuration Options¶
Debug Build¶
Custom Install Location¶
Enable/Disable Features¶
Troubleshooting¶
CMake Configuration Fails¶
Problem: CMake cannot find dependencies
Solution:
- Verify vcpkg integration: vcpkg integrate install
- Check CMAKE_TOOLCHAIN_FILE path
- Ensure all dependencies are installed
Build Errors¶
Problem: Compilation errors in C/C++ code
Solution:
- Update Visual Studio to latest version
- Clean build directory: rmdir /s /q build
- Verify Windows SDK is installed
- Check for missing dependencies
Missing DLLs at Runtime¶
Problem: Application fails to start due to missing DLLs
Solution:
- Copy DLLs from vcpkg installed directory
- Add vcpkg bin directory to PATH
- Use static linking: -DVCPKG_TARGET_TRIPLET=x64-windows-static
OpenGL Issues¶
Problem: Graphics rendering problems
Solution:
- Update graphics drivers
- Check OpenGL version: glxinfo or GPU-Z
- Verify GPU supports OpenGL 3.0+
Development Setup¶
Visual Studio Integration¶
- Open
build/movian.slnin Visual Studio - Set movian as startup project
- Configure debugging:
- Right-click project → Properties
- Debugging → Working Directory:
$(OutDir) - Debugging → Command Arguments:
--debug
Debugging¶
Enable debug logging:
Set breakpoints in Visual Studio and press F5 to debug.
Code Formatting¶
Install clang-format:
Format code:
Performance Optimization¶
Release Build Optimizations¶
cmake .. ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_C_FLAGS="/O2 /GL" ^
-DCMAKE_EXE_LINKER_FLAGS="/LTCG"
Profile-Guided Optimization (PGO)¶
- Build with instrumentation
- Run typical workload
- Rebuild with profile data
Cross-Compilation¶
Building for ARM64¶
Packaging¶
Create Installer¶
Using NSIS:
Portable Build¶
Copy required files:
mkdir movian-portable
copy Release\movian.exe movian-portable\
copy Release\*.dll movian-portable\
xcopy /E /I resources movian-portable\resources
Continuous Integration¶
GitHub Actions Example¶
name: Windows Build
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
- name: Build
run: |
mkdir build
cd build
cmake .. -G Ninja
ninja