fix codeblock projectfiles and update instructions

This commit is contained in:
newfrenchy83 2021-02-03 19:58:36 +01:00 committed by GitHub
parent 6f237b7ac0
commit 043d49c6c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 13 deletions

View file

@ -1,6 +1,6 @@
## Compiling Wesnoth on Windows using CodeBlocks
(Last tested using Wesnoth 1.14.5+ on Code::Blocks 16.01)
(Last tested using Wesnoth 1.15.9+ on Code::Blocks 17.12)
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,18 +9,16 @@
2. Install CodeBlocks from <http://www.codeblocks.org/>.
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 <https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z>.
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
checkbox for this when choosing components to install).
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.
NOTE: You must make sure to download the 64-bit version.
To resolve out of memory errors when creating debug builds, follow these steps:
If you download the 32 bit version and you have out of memory errors when creating debug builds, you can follow these steps:
1. If you use 32-bit Windows, run in admin command prompt
```
@ -37,6 +35,8 @@
C:\masm32\bineditbin.exe /LARGEADDRESSAWARE cc1plus.exe
```
If you use the 64-bit version then you cannot use MASM32 since it doesn't have a 64 bit version, which means you cannot make a debug build.
4. Download the latest `CodeBlocksWinSDK*.zip` package from <http://sourceforge.net/projects/wesnoth/files/SDK/>.
The package contains the right version/build combination of source headers,

View file

@ -38,8 +38,8 @@
<Add option="-Wunused-parameter" />
<Add option="-DHAVE_PYTHON" />
<Add option="-DUSE_GZIP" />
<Add option="-D_WIN32_WINNT=0x0501" />
<Add option="-D_WIN32_IE=0x0501" />
<Add option="-D_WIN32_WINNT=0x0601" />
<Add option="-D_WIN32_IE=0x0601" />
<Add directory="../../src" />
</Compiler>
<Linker>
@ -61,6 +61,8 @@
<Add library="libboost_regex" />
<Add library="libboost_system" />
<Add library="libboost_thread" />
<Add library="libboost_coroutine"/>
<Add library="libboost_context"/>
<Add library="libboost_timer" />
<Add library="libboost_zlib" />
<Add library="libole32" />

View file

@ -35,7 +35,7 @@ bootstrap gcc
```
Then run 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
.\b2 -sZLIB_SOURCE=..\zlib-1.2.11 -sBZIP2_SOURCE=..\bzip2-1.0.6 -j2 --with-coroutine --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=64
```
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.
@ -47,7 +47,7 @@ Run this command for generate `bcp.exe`
```
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 spirit test boost\nondet_random.hpp boost\fusion\include\define_struct.hpp ..\include
dist\bin\bcp.exe algorithm asio assign bimap coroutine 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 spirit test boost\nondet_random.hpp boost\fusion\include\define_struct.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'.

View file

@ -38,8 +38,8 @@
<Add option="-Wunused-parameter" />
<Add option="-DHAVE_PYTHON" />
<Add option="-DUSE_GZIP" />
<Add option="-D_WIN32_WINNT=0x0501" />
<Add option="-D_WIN32_IE=0x0501" />
<Add option="-D_WIN32_WINNT=0x0601" />
<Add option="-D_WIN32_IE=0x0601" />
<Add directory="../../src" />
</Compiler>
<Linker>
@ -61,6 +61,8 @@
<Add library="libboost_regex"/>
<Add library="libboost_system"/>
<Add library="libboost_thread"/>
<Add library="libboost_coroutine"/>
<Add library="libboost_context"/>
<Add library="libboost_timer"/>
<Add library="libboost_zlib"/>
<Add library="libole32" />