Difference between revisions of "Development on Windows"

From GIMX
Jump to: navigation, search
 

(69 intermediate revisions by the same user not shown)

Line 1: Line 1:
 
<languages />
 
<languages />
 
<translate><!--T:1-->
 
<translate><!--T:1-->
This wiki explains how to install a compilation environment (based on MinGW) to build GIMX.<br />
+
This wiki explains how to install a compilation environment (based on Msys2/mingw64) to build GIMX.<br />
It also explains how to install Eclipse CDT (with SVN) and perform a checkout.<br />
+
It also explains how to install Eclipse CDT and perform a checkout.<br />
 
Unless otherwise specified, perform a default installation (default directories, etc).
 
Unless otherwise specified, perform a default installation (default directories, etc).
  
==MinGW/MSYS== <!--T:2-->
+
==Msys2/MinGW64== <!--T:2-->
  
<!--T:3-->
+
<!--T:28-->
This part explains how to install the compilation toolchain.<br />
+
Download and install [https://msys2.github.io/ Msys2].<br />
Download and run [http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/mingw-get-inst-20120426.exe/download Mingw 20120426].<br />
+
Make sure to follow the instructions from the Msys2 wiki.
The only thing to configure during the installation process: in the "Select Components" panel, select "C++ Compiler" and "MSYS Basic System".
 
  
<!--T:4-->
+
<!--T:29-->
<div class="image200px">[http://www.gimx.fr/img/wiki/MinGW.jpg http://www.gimx.fr/img/wiki/MinGW.jpg]</div>
+
If you are running a 32-bit Windows, install the i686 version.<br />
 +
If you are running a 64-bit Windows, install the x84_64 version.
  
<!--T:5-->
+
==Checkout installation and build tools== <!--T:33-->
Append ";C:\MinGW\bin;C:\MinGW\msys\1.0\bin" (without quotes, don't forget the first semicolon) to your system PATH (Control Panel > System > Advanced > Environment Variables > System variables > Path > Edit).
 
  
<!--T:6-->
+
'''Run "MSYS2 MSYS" from Start menu, and type:'''
<div class="image200px">[http://www.gimx.fr/img/wiki/System.jpg http://www.gimx.fr/img/wiki/System.jpg]</div>
 
  
<!--T:7-->
+
<!--T:34-->
<div class="image200px">[http://www.gimx.fr/img/wiki/SystemProperties.jpg http://www.gimx.fr/img/wiki/SystemProperties.jpg]</div>
+
pacman --noconfirm -S git
 +
git clone <nowiki>https://github.com/matlo/GIMX-build.git</nowiki>
  
<!--T:8-->
+
==Development tools== <!--T:30-->
<div class="image200px">[http://www.gimx.fr/img/wiki/EnvVar.jpg http://www.gimx.fr/img/wiki/EnvVar.jpg]</div>
 
  
<!--T:9-->
+
<!--T:31-->
<div class="image200px">[http://www.gimx.fr/img/wiki/Path.jpg http://www.gimx.fr/img/wiki/Path.jpg]</div>
+
'''Run "MSYS MinGW 64-bit" from Start menu, and type:'''
  
==Libraries== <!--T:10-->
+
<!--T:32-->
 +
cd GIMX-build/windows
 +
./install.sh
  
<!--T:11-->
+
On 32-bit Windows run Run "MSYS2 MinGW 32-bit" from Start menu instead.
This part explains how to install the required libraries (libiconv, SDL, wxWidgets, libxml, zlib).<br />
 
Run C:\MinGW\msys\1.0\msys.bat<br />
 
Install wget:
 
  
    <!--T:12-->
+
==Inno setup== <!--T:35-->
mingw-get install msys-wget
 
  
<!--T:13-->
+
<!--T:36-->
Download and run the install.sh script:
+
Download and install [http://www.jrsoftware.org/isdl.php Inno setup].
 
 
    <!--T:14-->
 
wget http://diyps3controller.googlecode.com/svn/trunk/build/win/install.sh
 
    ./install.sh
 
  
 
==Automated command-line build== <!--T:15-->
 
==Automated command-line build== <!--T:15-->
  
 
<!--T:16-->
 
<!--T:16-->
This part explains how to checkout and build GIMX from the command-line.<br />
+
'''Run "MSYS2 MinGW 64-bit" from Start menu, and type:'''
Run C:\MinGW\msys\1.0\msys.bat<br />
 
Download and run the build.sh script:
 
  
    <!--T:17-->
+
<!--T:17-->
wget http://diyps3controller.googlecode.com/svn/trunk/build/win/build.sh
+
cd GIMX-build/windows
    ./build.sh
+
./build.sh
  
 
<!--T:18-->
 
<!--T:18-->
All binaries are copied into C:\MinGW\msys\1.0\home\username\GIMX\setup. Binaries gimx-config, gimx-fpsconfig and gimx-serial can be launched from that folder as it contains all required libraries and configuration files.
+
All binaries are copied into <path to msys>\home\<username>\GIMX\setup, e.g. C:\msys32\home\matlo\GIMX\setup.<br />
 +
A setup file is also created.
 +
 
 +
On 32-bit Windows run Run "MSYS2 MinGW 32-bit" from Start menu instead.
  
 
==Eclipse IDE== <!--T:19-->
 
==Eclipse IDE== <!--T:19-->
Line 65: Line 58:
 
<!--T:20-->
 
<!--T:20-->
 
This part is only useful in case you intend to modify the source code. If you only want to build GIMX, you can skip it.<br />
 
This part is only useful in case you intend to modify the source code. If you only want to build GIMX, you can skip it.<br />
Eclipse is an IDE that can be stacked onto the MinGW/MSYS compilation toolchain.<br />
+
Eclipse is an IDE that can be stacked onto the Msys2/MinGW64 compilation toolchain.<br />
 
Be sure to have a [http://www.oracle.com/technetwork/java/javase/downloads/index.html java JRE] installed on your system.<br />
 
Be sure to have a [http://www.oracle.com/technetwork/java/javase/downloads/index.html java JRE] installed on your system.<br />
Download [http://www.eclipse.org/downloads/ Eclipse IDE for C/C++ Developers]. Unzip it to wherever you want.<br />
+
Download [https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2018-12/R/eclipse-cpp-2018-12-R-win32-x86_64.zip Eclipse CDT 2018-12]. Unzip it to wherever you want.<br />
Run eclipse.exe.
+
Run eclipse.exe.<br />
 +
Use default workspace folder.<br />
 +
 
 +
===Cloning project===
 +
 
 +
Copy the following URL: <nowiki>https://github.com/matlo/GIMX.git</nowiki><br />
 +
Click on "Window > Show View > Other...", select "Git repositories", and click on "Open".<br />
 +
Type Ctrl+V. A "Clone Git Repository" window should appear.<br />
 +
First step defines the repository to import. Click on "Next".<br />
 +
Second step defines the branch selection. Select the branches you are interested in. "master" branch contains latest stable source code. Click on "Next".<br />
 +
Third step defines local destination. A standard value for "Directory" is "C:\Users\<username>\git\GIMX". Make sure to select "Clone submodules". Click on "Finish".
 +
 
 +
===Importing project===
 +
 
 +
In the "Git Repositories" view, right click on the cloned git repository, and click on "Import Projects...". Select the project folder (for example "GIMX") and click on "Finish".<br />
 +
 
 +
===Building project===
 +
 
 +
In the "Project Explorer" view, right-click on the project, and click on "Build Project".<br />
 +
If the build fails at finding make or gcc :
 +
* in the "Project Explorer" view, right-click on the project, and click on "Properties"
 +
* unfold "C/C++ Build", and click on "Environment"
 +
* make sure msys2 and mingw64 bin folders are present in the PATH variable
 +
** for example, if you used default installation folder for msys2 (C:\msys64), you should have this at the end of the PATH variable: C:\msys64\usr\bin;C:\msys64\mingw64\bin
 +
** it is not a good idea to change PATH at the system level, as this could lead to other apps malfunctioning
 +
 
 +
===Debug build===
  
===SVN Plugin=== <!--T:21-->
+
* in the "Project Explorer" view, right-click on the project, and click on "Properties"
 +
* in "C/C++ Build", uncheck "Use default build command"
 +
* enter "make -j 4 DEBUG=1 VERBOSE=1" without quotes as "Build command" (replace 4 with your number of CPU cores)
 +
* in the "Project Explorer" view, right-click on the project, and click on "Clean project"
 +
* in the "Project Explorer" view, right-click on the project, and click on "Build project"
  
<!--T:22-->
+
===Notes===
Help>Install New Software<br />
 
Work with: select your eclipse release name (as of this writing, Indigo).<br />
 
type filter text: svn<br />
 
Select "Subversive SVN Integration for the Mylyn Project" and "Subversive SVN Team Provider".<br />
 
Proceed to installation (select latest SVN Kit - as of this writing, 1.3.5), and restart eclipse.
 
  
===Project checkout=== <!--T:23-->
+
The build system does not detect changes in headers. Clean and rebuild project after modifying a header.
  
<!--T:24-->
 
Project Explorer view, right click, New>Other.<br />
 
Select SVN>Project from SVN, click next.<br />
 
Enter URL: https://diyps3controller.googlecode.com/svn/trunk/sixaxis-emu<br />
 
Click next, Click no (do not nomalize URL), and click "Trust Always" (googlecode certificate).<br />
 
Click Head Revision, and click Finish.<br />
 
Check out as: Select "Check out as a project configured using the New Project Wizard", select "Head Revision", and click finish.<br />
 
Select a wizard: Select "C project" and click next.<br />
 
Enter a Project name, and select "Makefile Project > Empty Project", and click next.<br />
 
Click on "Advanced Settings", click on "C/C++ build", uncheck "Use default build command", and write "make -f Makefile.win" as "Build command".<br />
 
Click on the "Behaviour" panel, check "Use parallel build" and set the "Use parallel jobs" to the right number of CPU cores.<br />
 
Click Finish.<br />
 
Check out is performed, and the new project appears in the Project Explorer view. The project is build automatically.
 
 
</translate>
 
</translate>

Latest revision as of 13:52, 7 January 2021

Other languages:
English • ‎français

This wiki explains how to install a compilation environment (based on Msys2/mingw64) to build GIMX.
It also explains how to install Eclipse CDT and perform a checkout.
Unless otherwise specified, perform a default installation (default directories, etc).

Msys2/MinGW64

Download and install Msys2.
Make sure to follow the instructions from the Msys2 wiki.

If you are running a 32-bit Windows, install the i686 version.
If you are running a 64-bit Windows, install the x84_64 version.

Checkout installation and build tools

Run "MSYS2 MSYS" from Start menu, and type:

pacman --noconfirm -S git
git clone https://github.com/matlo/GIMX-build.git

Development tools

Run "MSYS MinGW 64-bit" from Start menu, and type:

cd GIMX-build/windows
./install.sh

On 32-bit Windows run Run "MSYS2 MinGW 32-bit" from Start menu instead.

Inno setup

Download and install Inno setup.

Automated command-line build

Run "MSYS2 MinGW 64-bit" from Start menu, and type:

cd GIMX-build/windows
./build.sh

All binaries are copied into <path to msys>\home\<username>\GIMX\setup, e.g. C:\msys32\home\matlo\GIMX\setup.
A setup file is also created.

On 32-bit Windows run Run "MSYS2 MinGW 32-bit" from Start menu instead.

Eclipse IDE

This part is only useful in case you intend to modify the source code. If you only want to build GIMX, you can skip it.
Eclipse is an IDE that can be stacked onto the Msys2/MinGW64 compilation toolchain.
Be sure to have a java JRE installed on your system.
Download Eclipse CDT 2018-12. Unzip it to wherever you want.
Run eclipse.exe.
Use default workspace folder.

Cloning project

Copy the following URL: https://github.com/matlo/GIMX.git
Click on "Window > Show View > Other...", select "Git repositories", and click on "Open".
Type Ctrl+V. A "Clone Git Repository" window should appear.
First step defines the repository to import. Click on "Next".
Second step defines the branch selection. Select the branches you are interested in. "master" branch contains latest stable source code. Click on "Next".
Third step defines local destination. A standard value for "Directory" is "C:\Users\<username>\git\GIMX". Make sure to select "Clone submodules". Click on "Finish".

Importing project

In the "Git Repositories" view, right click on the cloned git repository, and click on "Import Projects...". Select the project folder (for example "GIMX") and click on "Finish".

Building project

In the "Project Explorer" view, right-click on the project, and click on "Build Project".
If the build fails at finding make or gcc :

  • in the "Project Explorer" view, right-click on the project, and click on "Properties"
  • unfold "C/C++ Build", and click on "Environment"
  • make sure msys2 and mingw64 bin folders are present in the PATH variable
    • for example, if you used default installation folder for msys2 (C:\msys64), you should have this at the end of the PATH variable: C:\msys64\usr\bin;C:\msys64\mingw64\bin
    • it is not a good idea to change PATH at the system level, as this could lead to other apps malfunctioning

Debug build

  • in the "Project Explorer" view, right-click on the project, and click on "Properties"
  • in "C/C++ Build", uncheck "Use default build command"
  • enter "make -j 4 DEBUG=1 VERBOSE=1" without quotes as "Build command" (replace 4 with your number of CPU cores)
  • in the "Project Explorer" view, right-click on the project, and click on "Clean project"
  • in the "Project Explorer" view, right-click on the project, and click on "Build project"

Notes

The build system does not detect changes in headers. Clean and rebuild project after modifying a header.