-
-
Notifications
You must be signed in to change notification settings - Fork 2
Windows Builds
On Windows the use of Visual Studio (MSVC) is preferred for optimal builds and debugging. VS Code also works, especially for AI development, but CMake will be more awkward to configure and runtime debugging in the UI is less capable. WSL can be used for developing commandline applications, but follow the guide for Linux Builds in that case.
Claude and ChatGPT are very capable in building Kōtuku and customising it. A "build project" chat request from the root folder is sufficient if your environmnent has all the necessary tools pre-installed.
If you opt to install the full Visual Studio C++ suite from Microsoft, it will do most of the heavy lifting for you. Open the kotuku folder from VS and it will auto-detect Kōtuku's CMake files. We recommend adding --parallel to the cmake "Build command arguments" input box for fast builds. Sequential builds are otherwise extremely slow.
Once built, VS can run Tiri scripts using the origo.exe program. The .vs/launch.vs.json file manages launch configuration, and a working example is included below.
{
"version": "0.2.1", "defaults": {},
"configurations": [ {
"type": "launch",
"project": "CMakeLists.txt",
"projectTarget": "origo.exe (Install)",
"name": "Widgets Demo",
"args": [ "--log-api", "${workspaceRoot}/examples/widgets.tiri" ]
}
]
}It is possible to forgo the Visual Studio UI and opt for a leaner build environment with MSVC Build Tools. This is a more hands-on build process. Obtain the Microsoft C++ Build Tools and choose 'Desktop Development with C++' on install. Your Start Menu will include a new launch option for 'Developer PowerShell for VS' that you can use to open a correctly preconfigured build environment.
Using PowerShell you should cd to the Kōtuku folder and run cmake for configuration as follows:
cmake -S . -B visual-studio -DCMAKE_INSTALL_PREFIX=local -DBUILD_DEFS=OFF -DKOTUKU_STATIC=ON
To compile a release build, run cmake --build visual-studio --parallel --config Release.
To install a release build to the local folder, run cmake --install visual-studio --config Release.
Debug builds are created by switching from --config Release to --config Debug in the above.
The libjpeg-turbo library benefits from the installation of the nasm compiler if it is available (but will still work otherwise). To install nasm from Powershell, run winget install NASM.NASM.
DEPRECATED: Due to reliability issues in the MSYS2 and MinGW build environment, the use of GCC is no longer supported. The following instructions can be followed if you have no other choice for integrating Kōtuku with another project, but the final binary may contain hidden faults.
MSYS2 and MinGW are required for a GCC based Windows build. Please note that the default MSYS2 release of GCC is not supported. The MinGW toolchain must be installed as indicated below.
- Download the MSYS2 archive and install to
C:\msys64. - Launch MSYS2 and run
pacman -Syu; relaunch MSYS2 and runpacman -Syuagain. - Install all necessary dev packages with
pacman -S base-devel gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain - Install Windows Terminal
- In Windows Terminal settings (accessible by the down arrow) click 'Add a new profile'. Apply a
NameofMSYSandCommand lineofC:\msys64\usr\bin\bash.exe --login -i. Save and open an MSYS terminal. Enternano ~/.bashrc. At the end of the file, insertexport MSYSTEM=MINGW64andexport "PATH=/mingw64/bin:$PATH$". Save withCTRL-O, close the terminal and open a new one. - Enter
gcc --versionto ensure that the build environment's gcc executable is accessible.
From the Kōtuku folder, the following will configure the build process, compile the framework and then install it:
cmake -S . -B release -DCMAKE_BUILD_TYPE=Release -G"MinGW Makefiles"
cmake --build release --parallel -- -O
cmake --install release
If you need to use GDB to debug the framework then the following would suffice. In this case we are going to install to a local folder so that the build will not interfere with the release installation.
cmake -S . -B debug -DCMAKE_BUILD_TYPE=Debug -G"MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=local -DBUILD_DEFS=OFF
cmake --build debug --parallel -- -O
cmake --install debug