PCSX2 Documentation/PCSX2 Build Scripts: Difference between revisions

Jump to navigation Jump to search
→‎Expert debugging parameters: wxWidgets 2.8 is not supported anymore (and doesn't compile)
(→‎Expert debugging parameters: wxWidgets 2.8 is not supported anymore (and doesn't compile))
 
(16 intermediate revisions by 2 users not shown)
Line 9: Line 9:
The CMake build process is controlled by [https://github.com/PCSX2/pcsx2/blob/master/CMakeLists.txt This file here]. Cmake will check if directories exist for the different modules of pcsx2 (core, plugins, etc) and then search for CMakeLists.txt files within those directories, which in turn may check for further subdirectories. For example, the CMakeLists.txt file in the plugins folder will check if directories exist for the different pcsx2 plugins. There will in turn be a CMakeLists.txt file in each of the plugin folders. When you add a new source code file, you will need to add it to the CMakeLists.txt file for the module of pcsx2 you are working on.
The CMake build process is controlled by [https://github.com/PCSX2/pcsx2/blob/master/CMakeLists.txt This file here]. Cmake will check if directories exist for the different modules of pcsx2 (core, plugins, etc) and then search for CMakeLists.txt files within those directories, which in turn may check for further subdirectories. For example, the CMakeLists.txt file in the plugins folder will check if directories exist for the different pcsx2 plugins. There will in turn be a CMakeLists.txt file in each of the plugin folders. When you add a new source code file, you will need to add it to the CMakeLists.txt file for the module of pcsx2 you are working on.


==Expert mode: CMake build parameters==
==CMake Build Parameters==
Basic parameters:
 
===Basic parameters:===
*Use Release/Devel/Debug : <code>-DCMAKE_BUILD_TYPE=Release|Devel|Debug</code>
*Use Release/Devel/Debug : <code>-DCMAKE_BUILD_TYPE=Release|Devel|Debug</code>
**<code>Release</code>: Best in speed, but provides little or no debug/crash info.
**<code>Release</code>: Best in speed, but provides little or no debug/crash info.
Line 18: Line 19:
*Build all plugins: <code>-DEXTRA_PLUGINS=TRUE</code>
*Build all plugins: <code>-DEXTRA_PLUGINS=TRUE</code>


Expert parameters (not supported, the best is to use the default options):
===Expert parameters===
*Tune C flags : `-DUSER_CMAKE_C_FLAGS:STRING="cflags"`
''(not supported, the best is to use the default options)''
*Tune C++ flags : `-DUSER_CMAKE_CXX_FLAGS:STRING="cxxflags"`
*Tune C flags : <code>-DUSER_CMAKE_C_FLAGS:STRING="cflags"</code>
*Tune linker flags : `-DUSER_CMAKE_LD_FLAGS:STRING="ldflags"`
*Tune C++ flags : <code>-DUSER_CMAKE_CXX_FLAGS:STRING="cxxflags"</code>
*Tune linker flags : <code>-DUSER_CMAKE_LD_FLAGS:STRING="ldflags"</code>


Expert debugging parameters (typical developper only option):
===Expert debugging parameters===
*Build GS replayer: `-DBUILD_REPLAY_LOADERS=TRUE`
''(typical developers-only option)''
*Use Address Sanitizer: `-DUSE_ASAN=TRUE`
*Build GS replayer: <code>-DBUILD_REPLAY_LOADERS=TRUE</code>
*Force wxWidget 2.8 (to spot a regression) : `-DWX28_API=TRUE`
*Use Address Sanitizer: <code>-DUSE_ASAN=TRUE</code>


Experimental parameters (not supported, the best is to use the default options):
===Experimental parameters===
*zzogl: Use GLSL for shading instead of nvidia cg : `-DGLSL_API=TRUE`
''(not supported, the best is to use the default options)''
*zzogl: Use EGL instead of GLX : `-DEGL_API=TRUE`
*zzogl: Use GLSL for shading instead of nvidia cg : <code>-DGLSL_API=TRUE</code>
*GSdx: Use openGL ES3.1 instead of pure openGL : `-DGLES_API=TRUE`
*zzogl: Use EGL instead of GLX : <code>-DEGL_API=TRUE</code>
*Use SDL2 (wxWidget must be linked with SDL1) : `-DSL2_API=TRUE`
*GSdx: Use openGL ES3.1 instead of pure openGL : <code>-DGLES_API=TRUE</code>
*Use GTK3 (wxWidget must be built with GTK3 support) : `-DGTK3_API=TRUE`
*Use SDL2 (wxWidget must be linked with SDL1) : <code>-DSL2_API=TRUE</code>
*Use clang (nothing work) : `-DUSE_CLANG=TRUE`
*Use GTK3 (wxWidget must be built with GTK3 support) : <code>-DGTK3_API=TRUE</code>
*64 bits support (nothing work): `-D64BIT_BUILD_DONT_WORK=TRUE`
*Use clang (nothing work) : <code>-DUSE_CLANG=TRUE</code>
*64 bits support (nothing work): <code>-D64BIT_BUILD_DONT_WORK=TRUE</code>


Expert options for package creation
===Expert options for package creation===
*Enable package mode : follow the FHS for distribution `-DPACKAGE_MODE=TRUE`
*Enable package mode : follow the FHS for distribution <code>-DPACKAGE_MODE=TRUE</code>
*Plugin install path in package mode : `-DPLUGIN_DIR="/usr/lib/pcsx2"`
*Plugin install path in package mode : <code>-DPLUGIN_DIR="/usr/lib/pcsx2"</code>
*GameDB install path in package mode : `-DGAMEINDEX_DIR="/usr/share/games/pcsx2"`
*GameDB install path in package mode : <code>-DGAMEINDEX_DIR="/usr/share/games/pcsx2"</code>
*GLSL shader install directory : `-DGLSL_SHADER_DIR="/usr/share/games/pcsx2"`
*GLSL shader install directory : <code>-DGLSL_SHADER_DIR="/usr/share/games/pcsx2"</code>
*Update po (translation file) : `-DCMAKE_BUILD_PO=TRUE`
*Update po (translation file) : <code>-DCMAKE_BUILD_PO=TRUE</code>
*Rebuild shader : `-DREBUILD_SHADER=TRUE`
*Rebuild shader : <code>-DREBUILD_SHADER=TRUE</code>
*Disable AVX: `-DDISABLE_ADVANCE_SIMD=TRUE`
*Disable AVX: <code>-DDISABLE_ADVANCE_SIMD=TRUE</code>
*Enable/disable the stipping : `-DCMAKE_BUILD_STRIP=TRUE|FALSE`
*Enable/disable the stipping : <code>-DCMAKE_BUILD_STRIP=TRUE|FALSE</code>
**`TRUE`: Remove debugging information.
**<code>TRUE</code>: Remove debugging information.
**`FALSE`: Keep symbols. Better for debug. (recommended since it should not have any impact on speed)
**<code>FALSE</code>: Keep symbols. Better for debug. (recommended since it should not have any impact on speed)


==Running CMake to generate the makefile:==
==Running CMake to generate the makefile:==
Line 53: Line 56:
It is advised to use a build method that places build files outside the PCSX2 sources directory, as it makes it easier to delete all CMake build files:
It is advised to use a build method that places build files outside the PCSX2 sources directory, as it makes it easier to delete all CMake build files:


mkdir build && cd build
<source lang="bash">
cmake .. <other options>
$ mkdir build
$ cd build
$ cmake .. <other options>
</source>


====Do the compilation:====
====Do the compilation:====
 
<source lang="bash">
make  
$ make  
 
</source>


====Install files:====
====Install files:====
```
<source lang="bash">
make install  
$ make install
```
</source>


====Reporting Cmake bugs====
====Reporting Cmake bugs====
Line 71: Line 77:


#Linux distribution, the current kernel version, and architecture (32-bit or 64-bit)
#Linux distribution, the current kernel version, and architecture (32-bit or 64-bit)
#The CMake commands. For example: `cmake CMakeLists.txt`
#The CMake commands. For example: <code>cmake CMakeLists.txt</code>
#''All'' of CMake's output. Something like this is good:
#''All'' of CMake's output. Something like this is good:


```
<source lang="text">
-- The C compiler identification is GNU
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- The CXX compiler identification is GNU
Line 118: Line 124:
-- Generating done
-- Generating done
-- Build files have been written to: /mnt/playstation/emulateur/package/pcsx2.snapshot-4810
-- Build files have been written to: /mnt/playstation/emulateur/package/pcsx2.snapshot-4810
```
</source>


==Ubuntu PPA==
==Ubuntu PPA==
Line 126: Line 132:
====Add the x86 architecture to your package manager (x64 installs of 12.04 or newer only)====
====Add the x86 architecture to your package manager (x64 installs of 12.04 or newer only)====
In a terminal, type:
In a terminal, type:
````
<source lang="bash">
sudo dpkg --add-architecture i386
$ sudo dpkg --add-architecture i386
````
</source>


#### Add the multiverse package repository
====Add the multiverse package repository====
Uncomment lines looking like this, where trusty is replaced by your Ubuntu version
Uncomment lines looking like this, where trusty is replaced by your Ubuntu version
````
 
<source lang="bash">
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
````
</source>
 
====Add the PCSX2 PPA to your software sources====


#### Add the PCSX2 PPA to your software sources


In a terminal, type:   
In a terminal, type:   
```
 
<source lang="bash">
sudo add-apt-repository ppa:gregory-hainaut/pcsx2.official.ppa
sudo add-apt-repository ppa:gregory-hainaut/pcsx2.official.ppa
sudo apt-get update
sudo apt-get update
```
</source>


#### Install the package on your system
====Install the package on your system====
   
   
```
<source lang="bash">
sudo apt-get install pcsx2
sudo apt-get install pcsx2
```
</source>


## Arch Linux
==Arch Linux==
NOTE: for 64-bit architectures, multilib must be enabled in order to install PCSX2.  
NOTE: for 64-bit architectures, multilib must be enabled in order to install PCSX2.  


### PCSX2 Stable
===PCSX2 Stable===


Open a terminal, and type:  
Open a terminal, and type:  
```
<source lang="bash">
sudo pacman -S pcsx2
$ sudo pacman -S pcsx2
```
</source>


### PCSX2 Unstable
===PCSX2 Unstable===
Add or uncomment the following lines in `/etc/pacman.conf`:
Add or uncomment the following lines in <code>/etc/pacman.conf</code>:
```
<source lang="bash">
[Multilib]
[Multilib]
Include = /etc/pacman.d/mirrorlist
Include = /etc/pacman.d/mirrorlist
```
</source>
 
Refresh package list:
Refresh package list:
```
<source lang="bash">
pacman -Sy
# pacman -Sy
```
</source>


Download the tarball from the [AUR package page](https://aur.archlinux.org/packages/pcsx2-git), and unpack it.
Download the tarball from the [https://aur.archlinux.org/packages/pcsx2-git AUR package page], and unpack it.
Open the folder that you just unpacked in a terminal, and type:  
Open the folder that you just unpacked in a terminal, and type:  
```
<source lang="bash">
makepkg -csi
$ makepkg -csi
```
</source>
This will build the package, automatically installing all dependencies. It will then prompt for your password to install the package with pacman.
This will build the package, automatically installing all dependencies. It will then prompt for your password to install the package with pacman.
{{PCSX2 Documentation Navbox}}
ninja
8

edits

Navigation menu