3.4 KiB
Compilation on Windows
The preferred build method on Windows is by using MSYS2 which is a collection of packages providing unix-like tools to build native Windows software.
This guide contains information about how to setup your build environment in an automated way by scripts. If you prefer to setup your environment manually, check this guide: WindowsMSys2_InstallGuide.md
You have to clone this repository (with git for windows) to a local folder, then start it in a terminal.
Automatic building
Run the following script:
<sourcefolder>\build_scripts\Windows-msys2\build.bat
It will install all neccessary tools to build RetrosShare, and build it with the default configuration.
After the script is finished, you can find the resulting .7z package here:
<sourcefolder>-msys2\deploy\
Advanced building
You can specifiy extra build options if you use the scripts under:
<sourcefolder>\build_scripts\Windows-msys2\build\
You have to specify the build options after each command.
Run the scripts in this order:
- build.bat: builds RetroShare
- pack.bat: makes a .7z archive with all the needed files to run the program
- build-installer: makes a self extracting installer (optional)
Build options
Always delete the build artifacts folder if you enable or disable extra features after the build command: <sourcefolder>-msys2\deploy\builds
- Mandatory
- 32 or 64: 32 or 64 bit version
- release or debug: normally you would like to use the release option
- Extra features (optional)
- autologin: enable autologin
- plugins: build plugins
- webui: enable remoting features and pack webui files
- indexing: build with deep channel and file indexing support
- tor: include tor in the package
- "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file <sourcefolder>\retroshare.pri
- For fixing compile problems (optional)
- singlethread: use only 1 thread for building, slow but useful if you don't find the error message in the console
- clang: use clang compiler instead of GCC
- noupdate: skip the msys2 update step, sometimes some msys2 packages are broken, you can manually switch back to the older package, and this option will prevent updating to the broken version again
Example:
build.bat 64 release autologin webui "CONFIG+=rs_use_native_dialogs" "CONFIG+=rs_gui_cmark"
pack.bat 64 release autologin webui tor
build-installer.bat 64 release autologin
Troubleshooting
- Run the command again, sometimes it works the second time, specially if it complains about restbed during bulding
- Delete the build artifacts: <sourcefolder>-msys2\deploy\builds
- Update msys2 manually:
- Open the terminal: <sourcefolder>-msys2\msys2\msys64\msys2.exe
- pacman -Sy
- pacman -Su
- Close the terminal
- Jump to 1. until it doesn't find more updates
- Start with a clean path environment variable, run <sourcefolder>\build_scripts\Windows-msys2\start-clean-env.bat, you will get a terminal with cleaned path
Updating webui
The sripts don't update the webui source code automatically once it is schecked out. You have to do it manually with your favourite git client.
You can find the webui sorce code here:
<sourcefolder>-webui