From 03c8272aea9ff5d30131786d906427bd81c00f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 8 Sep 2015 15:01:18 +0200 Subject: [PATCH] doc: updated MinGW-w64 building documentation. --- README.md | 2 +- doc/building.dox | 46 ++++++++++++++++++++++------------------- doc/getting-started.dox | 2 +- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index f7bd57747..b4e362c5c 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Minimal dependencies - C++ compiler with good C++11 support. Compilers which are tested to have everything needed are **GCC** >= 4.7, **Clang** >= 3.1 and **MSVC** 2015. - On Windows you can also use **MinGW**. GCC 4.6, 4.5, 4.4 and MSVC 2013 + On Windows you can also use **MinGW-w64**. GCC 4.6, 4.5, 4.4 and MSVC 2013 support involves some ugly workarounds and thus is available only in `compatibility` branch. * **CMake** >= 2.8.9 diff --git a/doc/building.dox b/doc/building.dox index 633299909..a5ea66a67 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -34,7 +34,7 @@ Minimal set of tools and libraries required for building is: - C++ compiler with good C++11 support. Compilers which are tested to have everything needed are **GCC** >= 4.7, **Clang** >= 3.1 and **MSVC** 2015. - On Windows you can also use **MinGW**. GCC 4.6, 4.5, 4.4 and MSVC 2013 + On Windows you can also use **MinGW-w64**. GCC 4.6, 4.5, 4.4 and MSVC 2013 support involves some ugly workarounds and thus is available only in `compatibility` branch. - **CMake** >= 2.8.9 @@ -89,14 +89,14 @@ want to set `CMAKE_INSTALL_RPATH` to `lib/` subdir of given prefix (e.g. @subsection building-windows Building on Windows -On Windows you can use either MinGW or MSVC 2013 compiler. It's then up to you -whether you will use QtCreator, Visual Studio or do the build from command- +On Windows you can use either MinGW-w64 or MSVC 2013 compiler. It's then up to +you whether you will use QtCreator, Visual Studio or do the build from command- line. Note that for most convenient usage it's best use some dedicated directory (e.g. `C:/Sys`) for installing dependencies instead of putting each dependency to its own directory in `C:/Program Files`. Then add its `bin/` subdir (e.g. `C:/Sys/bin`) to PATH so all the DLLs are found when running the -executables. If you are using MinGW, the `C:/MinGW` directory is in most cases -already prepared for exactly this. +executables. If you are using MinGW-w64, the `C:/MinGW` directory is in most +cases already prepared for exactly this. Then, when running CMake, set `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX` value to that directory (e.g. `-DCMAKE_INSTALL_PREFIX=C:/Sys`). @@ -121,7 +121,7 @@ project file generated by CMake in the build directory. @subsubsection building-windows-qtcreator Using QtCreator On Windows you can also use QtCreator (just QtCreator, you don't need the full -Qt SDK). Configure it to use CMake and either MSVC compiler or MinGW and and +Qt SDK). Configure it to use CMake and either MSVC compiler or MinGW-w64 and then just open project's root `CMakeLists.txt` file within it. QtCreator then asks you where to create build directory, allows you to specify initial CMake parameters (e.g. `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX`) and then you @@ -343,30 +343,34 @@ contents in `toolchains/` subdirectory. git submodule init git submodule update -@subsection building-cross-win Crosscompiling for Windows using MinGW +@subsection building-cross-win Crosscompiling for Windows using MinGW-w64 @note This guide is tailored mainly for crosscompiling from ArchLinux. For - this system there is also prepared `mingw32-magnum` development package in - `package/archlinux`, named `PKGBUILD-mingw32`. See + this system there is also prepared `mingw-w64-magnum` development package + in `package/archlinux`, named `PKGBUILD-mingw-w64`. See @ref building-packages-arch "above" for more information. -You will need MinGW32 versions of the compiler and all dependent libraries +You will need MinGW-w64 versions of the compiler and all dependent libraries (Corrade), i.e. these ArchLinux packages: -- `mingw32-gcc`, which depends on `mingw32-w32api` containing OpenGL headers -- `mingw32-runtime` -- `mingw32-corrade` +- `mingw-w64-gcc` +- `mingw-w64-corrade` -Then create build directory and run cmake and build command in it. You may need -to modify the `basic-mingw32.cmake` file and `CMAKE_INSTALL_PREFIX` to suit -your distribution filesystem hierarchy and specify path where Corrade is -installed in `CMAKE_PREFIX_PATH`. +Then create build directories for 32b/64b build and run cmake and build command +in them. You may need to modify the `basic-mingw-w64-32.cmake`/`basic-mingw-w64-64.cmake` +files and `CMAKE_INSTALL_PREFIX` to suit your distribution filesystem +hierarchy and specify path where Corrade is installed in `CMAKE_PREFIX_PATH`. - mkdir build-win && cd build-win + mkdir build-mingw-w64-32 && cd build-mingw-w64-32 cmake .. \ - -DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \ - -DCMAKE_PREFIX_PATH=/usr/i486-mingw32 \ - -DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32 + -DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw-w64-32.cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32 + cmake --build . + + mkdir build-mingw-w64-64 && cd build-mingw-w64-64 + cmake .. \ + -DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw-w64-64.cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32 cmake --build . Then you can install the package using `cmake --build . --target install` to diff --git a/doc/getting-started.dox b/doc/getting-started.dox index ccf6ce0fa..e8df4bce4 100644 --- a/doc/getting-started.dox +++ b/doc/getting-started.dox @@ -158,7 +158,7 @@ of build dir: make ./src/MyApplication -On Windows you can use either MinGW or MSVC 2013 compiler. It's then up to you +On Windows you can use either MSVC or MinGW-w64 compiler. It's then up to you whether you will use QtCreator or Visual Studio. With Visual Studio the most straightforward way to create the project file is via the command-line: