Compiling Gideros Source Windows

From GiderosMobile
Revision as of 09:55, 19 October 2026 by MoKaLux (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are not necessary for either building or deploying apps made with Gideros.

The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.


A QUICK GUIDE TO BUILD GIDEROS STUDIO ON WINDOWS & THE Win32 EXPORT TEMPLATE

Here are the easy steps to build Gideros Studio:

  • 1.1 Install Qt6
  • 1.2 Install MSYS2 Console
  • 2.1 Fetch gideros source code

After you have followed the steps above, we build Gideros Studio and the Win32 export template.

  • 2.2 Configure scripts

We don't set up the plugins for spout nor steam, so you need to edit C:/Dev/gideros_dev/scripts/Makefile.gid:

#DEFS
PLUGINS_DEFAULT=bitop lsqlite3 luasocket lfs json iad gamekit liquidfun reactphysics3d fastnoise cute_c2
PLUGINS_ALL=lsqlite3 luasocket lfs json bump ogg liquidfun gsfxr spine harfbuzz reactphysics3d fastnoise imgui cute_c2 clipper struct
ifneq ($(LUA_ENGINE),luau)
PLUGINS_ALL+=bitop
endif
PLUGINS_MOST=$(PLUGINS_ALL) microphone lpeg

PLUGINS_QT=$(PLUGINS_MOST) gmedia controller camera luamidi
#PLUGINS_QTWINONLY=spout steam
PLUGINS_QTWINONLY=
PLUGINS_QTMACONLY=steam
PLUGINS_QTLINUXONLY=
#PLUGINS_WIN32=$(PLUGINS_MOST) controller spout luamidi
PLUGINS_WIN32=$(PLUGINS_MOST) controller luamidi

Your C:/Dev/gideros_dev/scripts/Makefile.def can look something as simple as this:

QTBASEDIR=/c/Dev/Qt

WIN32_BIN=/c/Dev/msys64/mingw64/bin
export WIN32_BIN

QT_ARCH=mingw_64
QT_TOOLSARCH=mingw1120_64
QTVER=6.7.1
QT5ICUVER=54
  • 3 Building Gideros
  • 3.1 Build Qt tools
  • 3.2 Build Win32

And that's it, you will have latest Gideros Studio and all its tools available + the Win32 export template.

Extra: you can copy the templates from original Gideros and put them in the templates folder of your Gideros. You will then be able to export to usual devices (android, html, ...).

Windows 11 64bit

Install Qt

You can download the Qt for open source users at:

https://www.qt.io/development/download-qt-installer-oss

Double click on the downloaded file and follow instructions.

Recommended: version 6.7.1, installation folder "c/dev/Qt"

When installing, expand the tree view and ensure you have checked the following boxes:

  • Qt 6.7.1: MinGW 11.2.0 64-bit
  • Qt 6.7.1: Qt 5 compatibility module
  • Qt 6.7.1, Additional Libraries: Qt Multimedia
  • Qt 6.7.1, Additional Libraries: Qt Websockets
  • Build Tools: MinGW 11.2.0 64-bit
  • Build Tools: CMake 3.30.5
  • Build Tools: Ninja 1.12.1

Here are some screenshots:

If you already have Qt6 installed without those modules, you can add them via Qt MaintenanceTool.exe located in your Qt folder like so:

When you are done click finish.

Install MSYS2 Console

https://www.msys2.org/

Recommended: installation folder "c/dev/msys64"

Once installed, open MSYS2 shell (msys2_shell.cmd):

Then run the following commands:

note: copy/paste won’t work, you have to type the commands
pacman -Sy pacman
pacman -Syu
pacman -Su
pacman -S git
pacman -S make
pacman -S python
pacman -S tar
pacman -S zip
pacman -S unzip
pacman -S base-devel

# For exporting apps to the win32/64bit platform under a MinGW64
pacman -S mingw-w64-x86_64-toolchain # note: if asked choose ALL #
pacman -S mingw-w64-x86_64-glew
pacman -S mingw-w64-x86_64-curl
pacman -S mingw-w64-x86_64-libpng

Install Android Studio and NDK

(Not needed for this page)

https://developer.android.com/studio/index.html

https://developer.android.com/ndk/downloads/older_releases.html (old for gideros ndk 17c)

https://github.com/android/ndk/wiki (for newer releases)

Recommended NDK is 17c (the x86_64 version)

Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.

Install JAVA

(Not needed for this page)

You need the Java JDK from Oracle:

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Or an open JDK (recommanded):

https://adoptopenjdk.net/

Install Visual Studio

(Not needed for this page)

Visual Studio Community Edition 2022:

https://www.visualstudio.com/downloads/

Select the box Developing for Desktop apps and install.

Install Python

(Not needed for this page)

https://www.python.org/downloads/release/python-2712/

You need Python 2.7.12 or later to install emscripten properly.

Once installed, add it to your command line path, eg: c:\python27. On windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'

Install emscripten

(Not needed for this page)

http://kripken.github.io/emscripten-site/

You need this if you want to build for HTML5 + Facebook games.

Using a shell or MSYS2 (msys2_shell.cmd) go to your home or C: folder and type:

git clone https://github.com/juj/emsdk.git

Once that has completed open a command prompt in that folder on Windows.

Using emsdk, install and activate all the latest packages:

note: (on non-PC put ./ before emsdk)

emsdk install latest
emsdk activate latest
emsdk_env.bat

To use incoming branch of emscripten, use these commands instead:

note: (on non-PC put ./ before emsdk)

emsdk install sdk-incoming-64bit
emsdk activate sdk-incoming-64bit

To further use Gideros own git fork of emscripten:

cd emscripten/incoming
#Add a git remote link to your own repository
git remote add gideros https://github.com/gideros/emscripten.git
#Obtain the changes in your link
git fetch gideros
#Switch the emscripten-incoming tool to use your fork
git checkout -b gideros_incoming --track gideros/incoming
#Get back to emscripten directory and rebuild
cd ../..
emsdk install sdk-incoming-64bit

These can also be installed within emsdk: git, crunch, and spidermonkey:

note: (on non-PC put ./ before emsdk)

emsdk install git-1.9.4
emsdk install crunch-1.03
emsdk install spidermonkey-37.0.1-64bit
emsdk activate git-1.9.4
emsdk activate crunch-1.03
emsdk activate spidermonkey-37.0.1-64bit
emsdk_env.bat

Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.

The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.

https://cmake.org/download/

Install Steam SDK

(Not needed for this page)

https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip

Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.

This is necessary for the Steam plugin.

Install NSIS

(Not needed for this page)

https://nsis.sourceforge.io/Download

Install the software as you would any software. We will edit Makefile.def for it later.

Install Gideros from Source

Fetch gideros source code

Open MSYS2 shell: msys2_shell.cmd.

Navigate to the folder where you want to work. For example I want to put Gideros Github repo in my dev folder:

$ cd /c/dev

Then in the dev folder we will clone Gideros from GH to a folder of our choice (“gideros_dev” for example) using this git command:

git clone https://github.com/gideros/gideros gideros_dev


If you already have cloned Gideros to a local repo you can update it (cf: https://stackoverflow.com/questions/26984847/how-to-update-local-repo-with-master):

  • in MSYS2 shell (msys2_shell.cmd) navigate to your local repo, example:
cd /c/dev/gideros_dev
  • check your current branch with:
git branch
  • then update your local branch with the remote branch (master should be the name of your branch):
git pull origin master


If you want to update your existing local repo you can try:

git fetch
(git merge OR git pull)


If you already have cloned Gideros to a local repo but you made some changes to some files, then you may get this error message:

 error: Your local changes to the following files would be overwritten by merge
 Please, commit your changes or stash them before you can merge.
  • to fix this issue in MSYS2 shell (msys2_shell.cmd) you can try this:
git reset --hard
  • then redo:
git pull origin master


If you want to go to a specific branch, you can try:

git checkout `git rev-list -n 1 --before="2022-10-10 14:00" master`

Configure scripts

Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt install directory structure (see below that they are named differently by Qt). Here is the current version you will find in gideros scripts folder, please adapt accordingly:

QTBASEDIR=/c/Applications/Qt
MAKEJOBS=-j8
NDKBUILD=cmd //c /c/Applications/android-ndk-r17b/ndk-build.cmd
JAVA_HOME=C:\Program Files\Android\Android Studio\jre
ANDROID_HOME=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\Android\\\\Sdk
FXC="/c/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/fxc.exe"
# the following is one line!
MSBUILD="/c/Program Files/Microsoft Visual Studio/2022/Community/MSbuild/Current/Bin/MSBuild.exe"

EMSDK=/c/Applications/emscripten
EMSDKPATH=$(EMSDK):$(EMSDK)/node/14.15.5_64bit/bin:$(EMSDK)/python/3.9.2-1_64bit:$(EMSDK)/upstream/emscripten:$(EMSDK)/upstream/bin
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH
EMSDK_PREFIX=cmd //c

STEAMSDK=/c/Applications/steamworks_sdk_142
export STEAMSDK

#WIN32_BIN=/mingw32/bin
WIN32_BIN=/mingw64/bin
export WIN32_BIN

CRUNCHME=crunchme-qt-win.exe
NSIS=cmd //c "/c/Program Files (x86)/NSIS/makensis.exe"
WIN_SIGN="/c/Program Files (x86)/Windows Kits/10/bin/x86/signtool.exe"
#WIN_KEYSTORE=/path/to/cert.p12
#WIN_KEYPASS=KeyPassword
#WIN_KEYTSS="http://timestamp.comodoca.com"

MAC_HOST=user@host
MAC_PATH=gideros/gideros
OSX_SIGNING_IDENTITY="ID"
OSX_SIGNING_PASSWORD="keychain password"

QT_ARCH=mingw_64
QT_TOOLSARCH=mingw900_64
#QT_TOOLSARCH=mingw1120_64
QTVER=6.2.2
QT5ICUVER=54

Building Gideros

After setting up the Makefile.def, in MSYS2 shell (msys2_shell.cmd) navigate to your Gideros repo:

user@user MSYS ~
$ cd /c/Dev
$ cd gideros_dev

Then the first steps to build Gideros are:

make -f scripts/Makefile.gid prep.repo
make -f scripts/Makefile.gid qscintilla
make -f scripts/Makefile.gid qlexilla
make -f scripts/Makefile.gid versioning
note: for GitHub you may be prompted to enter your username and password

Build Qt tools:

This will build Gideros Studio and all its associated apps.

make –f scripts/Makefile.gid qtapp.install

=> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder

Win32:

This will build Gideros win32 export template.

make –f scripts/Makefile.gid win32.install

=> files in folder Build.Win/Templates/win32

Android:

This will build Gideros Android export template.

make –f scripts/Makefile.gid android.install

=> file GiderosAndroidPlayer.apk in folder Build.Win/Players

WinRT:

This will build Gideros winRT export template.

make –f scripts/Makefile.gid winrt.install

=> file _bundle.appxupload in folder Build.Win/Players/WinRT

note: if necessary, open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution

Html5:

This will build Gideros Html5 export template.

make –f scripts/Makefile.gid html5.install

=> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5

Plugins:

make –f scripts/Makefile.gid bundle.win

=> folder bin and file gplugin in folder Build.Win/All Plugins

To build everything that can be built on Windows:

make -f scripts/Makefile.gid all

Then you need to copy all the plugins to the 'Build.Win' folder with:

make -f scripts/Makefile.gid bundle.win

Cleaning

If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'. Example:

make -f scripts/Makefile.gid clean

Sometimes you need to make clean a particular build. To do this type 'make -f scripts/Makefile.gid' followed by something like 'html5' then '.clean'. Example:

make -f scripts/Makefile.gid html5.clean

Troubleshooting:

END