Skip to content

Build for Windows

Daijiro Fukuda edited this page Dec 16, 2022 · 6 revisions

Prepare

Install the following tools.

Build

  1. Build the forked GLFW in which we are developing IME support: https://github.com/clear-code/glfw/tree/3.4-2022-09-21+im-support-all
$ git clone --branch=3.4-2022-09-21+im-support-all https://github.com/clear-code/glfw.git
$ cd glfw
$ cmake -B build -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=bin
$ mingw32-make -C build install
  1. Build the forked raylib in which we are developing IME support: https://github.com/clear-code/raylib/tree/4.2-2022-12-14+better-ime-support-all
    • Set USE_EXTERNAL_GLFW ON
    • Specify the path of GLFW built in step-2 to CMAKE_PREFIX_PATH
      • Ex: -D CMAKE_PREFIX_PATH=C:/test/glfw/bin
$ git clone --branch=4.2-2022-12-14+better-ime-support-all https://github.com/clear-code/raylib.git
$ cd raylib
$ cmake -B build -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=bin -D USE_EXTERNAL_GLFW=ON -D CMAKE_PREFIX_PATH="{...}"
$ mingw32-make -C build install
  1. Build and run this app
    • Set USE_EXTERNAL_GLFW ON
    • Set USE_SOFT_FULLSCREEN ON
    • Specify the path of freetype to FREETYPE
      • Ex: -D FREETYPE="C:/test/freetype-windows-binaries"
    • Specify the path of GLFW built in step-2 to GLFW
      • Ex: -D GLFW="C:/test/glfw/bin"
    • Specify the path of raylib built in step-3 to RAYLIB
      • Ex: -D RAYLIB="C:/test/raylib/bin"
    • (Optional) Set MANAGE_PREEDIT_CANDIDATE ON to use this feature
$ cmake -B build -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=bin -D USE_EXTERNAL_GLFW=ON -D USE_SOFT_FULLSCREEN=ON -D FREETYPE="{...}" -D GLFW="{...}" -D RAYLIB="{...}"
$ mingw32-make -C build install
$ bin/RaylibIMEInputSampleApp.exe

Note

mingw32-make makes the app need libwinpthread-1.dll

In your environment, this will not be a problem, but you need to be careful when distributing the application.

The following method allows you to create an application for Windows that does not depend on libwinpthread-1.dll.

Use internal GLFW for Build

We are not currently developing in this way.

  1. Build the forked raylib in which we are developing IME support: https://github.com/clear-code/raylib/tree/better-ime-support-for-internal-glfw
$ git clone --branch=better-ime-support-for-internal-glfw https://github.com/clear-code/raylib.git
$ cd raylib
$ cmake -B build -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=bin
$ mingw32-make -C build install
  1. Build and run this app
    • Specify the path of raylib built in step-1 to RAYLIB
      • Ex: -D RAYLIB="C:/test/raylib/bin"
    • Specify the path of freetype to FREETYPE
      • Ex: -D FREETYPE="C:/test/freetype-windows-binaries"
$ cmake -B build -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=bin -D RAYLIB="{...}" -D FREETYPE="{...}"
$ mingw32-make -C build install
$ cd bin
$ .\RaylibIMEInputSampleApp.exe