diff --git a/packaging/windows/campaignd.rc b/packaging/windows/campaignd.rc new file mode 100644 index 000000000000..e8f5eecf48a8 --- /dev/null +++ b/packaging/windows/campaignd.rc @@ -0,0 +1,30 @@ +#include "windows.h" +#include "../../src/wesconfig.h" + +WESNOTH_ICON ICON "wesnoth-icon.ico" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION RC_VERSION_MAJOR, RC_VERSION_MINOR, RC_VERSION_REVISION, 0 +PRODUCTVERSION RC_VERSION_MAJOR, RC_VERSION_MINOR, RC_VERSION_REVISION, 0 +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "Wesnoth Campaign Server\0" + VALUE "InternalName", "campaignd\0" + VALUE "OriginalFilename", "campaignd.exe\0" + VALUE "FileVersion", VERSION "\0" + VALUE "ProductVersion", VERSION "\0" + VALUE "ProductName", "The Battle for Wesnoth\0" + VALUE "CompanyName", "The Battle for Wesnoth Project\0" + VALUE "LegalCopyright", "(C) 2003-2018 The Battle for Wesnoth Project\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/projectfiles/CodeBlocks/README.md b/projectfiles/CodeBlocks/README.md index a0af6283eb74..0204fbddcdf8 100644 --- a/projectfiles/CodeBlocks/README.md +++ b/projectfiles/CodeBlocks/README.md @@ -1,6 +1,6 @@ ## Compiling Wesnoth on Windows using CodeBlocks -(Last tested using Wesnoth 1.13.5+ on Code::Blocks 16.01) +(Last tested using Wesnoth 1.14.5+ on Code::Blocks 16.01) 1. Get a Wesnoth source tarball or Git repository clone. The folder which contains the data/, projectfiles/, and src/ subfolders is referred to as @@ -9,8 +9,8 @@ 2. Install CodeBlocks from . MinGW is not needed. -3. Download and unpack MinGW-w64 from https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.2.0/threads-posix/dwarf/i686-7.2.0-release-posix-dwarf-rt_v5-rev0.7z or - https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.2.0/threads-posix/sjlj/i686-7.2.0-release-posix-sjlj-rt_v5-rev0.7z. +3. Download and unpack MinGW-w64 from or + . Note that the project files in `wesnoth_root/projectfiles/CodeBlocks/` may contain a setting to compile with OpenMP support, so you should make sure that this option is enabled while installing the compiler (mark the @@ -19,6 +19,26 @@ NOTE: You must make sure to download the 32-bit version. Building a 64-bit Wesnoth executable on Windows is currently not supported and will fail with the SDK package provided in the next step. + + To resolve out of memory errors when creating debug builds, follow these steps: + + 1. If you use 32-bit Windows, run Admin command prompt + ``` + bcdedit/set IncreaseUserVa 3072 + ``` + + 2. Install MASM32; + + 3. Open `cmd`( as Admin too); + + 4. Run these commands in an admin command prompt + ``` + cd C:\..\mingw32\libexec\gcc\i686-w64-mingw32\7.2.0 + ``` + and + ``` + C:\masm32\bineditbin.exe /LARGEADDRESSAWARE cc1plus.exe + ``` 4. Download the latest `CodeBlocksWinSDK*.zip` package from . The package contains the right version/build combination of source headers, @@ -27,11 +47,15 @@ after new dependencies are added to Wesnoth or its version requirements change. + for versions > 1.12, follow these steps in `libraries.md` for updating libraries yourself. + + Unpack the file to any path of your choice, which will be referred to as `sdk_root` for the remainder of this file. The exact names of the folders containing the required files may vary; take note of them for the next steps. + 5. In CodeBlocks, open `wesnoth_root/projectfiles/CodeBlocks/wesnoth.workspace`. @@ -46,15 +70,15 @@ dialog. Enter the following settings into the text boxes: * Compiler's installation directory: the path to which you installed - tdm-gcc-5.1.0 (click on ... to browse for it). + mingw-w64 (click on ... to browse for it). * C compiler, C++ compiler, Linker for dynamic libs: g++.exe * Linker for static libs: ar.exe 7. Change to the Search directories -> Compiler tab and choose Add; enter the - path to `sdk_root/include_tdm_gcc/`. + path to `sdk_root/include_w64-mingw32/`. 8. Change to the Search directories -> Linker tab and choose Add; enter the - path to `sdk_root/lib_tdm_gcc/`. + path to `sdk_root/lib_w64-mingw32/`. 9. OPTIONAL: By default, CodeBlocks will only run one compiler instance at a time, making the overall build process very slow even with fast hardware. @@ -70,3 +94,5 @@ 12. To be able to run your build, copy all `*.dll` files from the `sdk_root/dll/` folder to `wesnoth_root` where the `*.exe` files are. + + diff --git a/projectfiles/CodeBlocks/campaignd.cbp b/projectfiles/CodeBlocks/campaignd.cbp new file mode 100644 index 000000000000..d88d08d46913 --- /dev/null +++ b/projectfiles/CodeBlocks/campaignd.cbp @@ -0,0 +1,153 @@ + + + + + + diff --git a/projectfiles/CodeBlocks/liblua.cbp b/projectfiles/CodeBlocks/liblua.cbp index e603e7fa588d..08d080f2026d 100644 --- a/projectfiles/CodeBlocks/liblua.cbp +++ b/projectfiles/CodeBlocks/liblua.cbp @@ -31,7 +31,7 @@ - + diff --git a/projectfiles/CodeBlocks/libraries.md b/projectfiles/CodeBlocks/libraries.md new file mode 100644 index 000000000000..1f800621a459 --- /dev/null +++ b/projectfiles/CodeBlocks/libraries.md @@ -0,0 +1,49 @@ +## Manually updating the external dependencies +We do our best to keep the build dependency repository up-to-date with the latest versions of the libraries +within, as well as synced with any build requirement changes. If you want to build with a different version +of a certain library, however, you can fetch the relevant files at the links below: + +* [**Boost:**](http://www.boost.org/users/download) Do note that you will need to build the necessary Boost +libraries yourself. See the [instructions]#updating-boost-libraries) +in the dependency repository for details. + +* [**SDL 2:**](https://www.libsdl.org/download-2.0.php) You'll want the "GCC 32/64-bit" Development +Libraries. + +* [**SDL_Image:**](https://www.libsdl.org/projects/SDL_image) Again, you'll want the "GCC 32/64-bit" +Development Libraries. + +* [**SDL_Mixer:**](https://www.libsdl.org/projects/SDL_mixer) Again, you'll want the "GCC 32/64-bit" +Development Libraries. + +The other libraries require complicated compilation procedures too in-depth to document here. + +## Updating Boost libraries + +Download and unpack the source of the libraries zlib, libbzip2, boost (version 1.64 or 1.68 preferred) +* http://www.bzip.org/downloads.html +* http://www.boost.org/users/download/ +* http://www.zlib.net/ + + Open `cmd`, go to the boost directory and type (with the correct paths of the other two libraries): + ``` +bootstrap gcc +``` + If you're already did this, run this immediately this command: +``` +.\b2 -sZLIB_SOURCE=..\zlib-1.2.11 -sBZIP2_SOURCE=..\bzip2-1.0.6 -j2 --with-date_time --with-filesystem --with-iostreams --with-locale --with-program_options --with-random --with-regex --with-system --with-thread --with-test --with-timer --toolset=gcc --layout=system variant=release address-model=32 +``` +Depending on your boost version, you may need to replace `..\` with the absolute paths to zlib and bzip. +If you have multiple versions of gcc, add `--toolset=gcc-X.Y.Z` with **X.Y.Z** being the target version number. + +Separate the required subset of the Boost source: +Run this command for generate `bcp.exe` +``` +.\b2 tools\bcp +``` +Create `include` in same path what `boost_...` and run this command: +``` +dist\bin\bcp.exe algorithm asio assign bimap container date_time dynamic_bitset exception filesystem iostreams iterator locale math mpl multi_array multi_index program_options ptr_container random range regex serialization system test boost\nondet_random.hpp ..\include +``` + +Replace the outdated files in 'cb/lib' with those from 'boost_.../stage/lib' and those in 'cb/include/boost' with the ones in 'boost_.../boost'. diff --git a/projectfiles/CodeBlocks/wesnoth.cbp b/projectfiles/CodeBlocks/wesnoth.cbp index 7d205ea9d521..31faf72d2267 100644 --- a/projectfiles/CodeBlocks/wesnoth.cbp +++ b/projectfiles/CodeBlocks/wesnoth.cbp @@ -30,7 +30,7 @@ - + @@ -66,17 +66,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -84,10 +84,6 @@ - - - @@ -239,18 +235,22 @@ + + + - - + - + + - + @@ -456,6 +456,8 @@ + + @@ -496,8 +498,6 @@ - - @@ -506,6 +506,8 @@ + + @@ -519,10 +521,10 @@ - - + + @@ -733,8 +735,6 @@ - - @@ -837,8 +837,6 @@ - - @@ -886,6 +884,8 @@ + + @@ -919,6 +919,8 @@ + + @@ -1047,8 +1049,6 @@ - - @@ -1171,8 +1171,6 @@ - - @@ -1229,4 +1227,3 @@ - diff --git a/projectfiles/CodeBlocks/wesnoth.workspace b/projectfiles/CodeBlocks/wesnoth.workspace index 4a47309c52c3..6c68c45bc37e 100644 --- a/projectfiles/CodeBlocks/wesnoth.workspace +++ b/projectfiles/CodeBlocks/wesnoth.workspace @@ -8,5 +8,8 @@ + + + diff --git a/projectfiles/CodeBlocks/wesnothd.cbp b/projectfiles/CodeBlocks/wesnothd.cbp index 750e4952c13b..8f2ac38f0563 100644 --- a/projectfiles/CodeBlocks/wesnothd.cbp +++ b/projectfiles/CodeBlocks/wesnothd.cbp @@ -29,7 +29,7 @@ - + @@ -52,14 +52,18 @@ - - - - - - - - + + + + + + + + + + + +