Skip to content

Commit

Permalink
fix codeblock projectfiles and update instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
newfrenchy83 committed Feb 3, 2021
1 parent 6f237b7 commit 043d49c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
14 changes: 7 additions & 7 deletions projectfiles/CodeBlocks/README.md
@@ -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
Expand All @@ -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
```
Expand All @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions projectfiles/CodeBlocks/campaignd.cbp
Expand Up @@ -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>
Expand All @@ -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" />
Expand Down
4 changes: 2 additions & 2 deletions projectfiles/CodeBlocks/libraries.md
Expand Up @@ -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.
Expand All @@ -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'.
6 changes: 4 additions & 2 deletions projectfiles/CodeBlocks/wesnothd.cbp
Expand Up @@ -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>
Expand All @@ -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" />
Expand Down

0 comments on commit 043d49c

Please sign in to comment.