Skip to content

Commit 30da776

Browse files
iscgarruevs
authored andcommitted
build: fix MinGW build failures and update documentation
This includes updating the ANGLE dependency to the latest commit in our fork which fixes a build issue with GCC. Additionally, a minor change to the build configuration was needed for building under 64-bit MinGW, which doesn't support `--large-address-aware`. With those in place, the documentation for building under MinGW is updated with working instructions and a recommendation to use MSYS2 for easier installation of the required tools.
1 parent 4b40794 commit 30da776

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ endif()
104104
if(MINGW)
105105
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
106106
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
107-
# Link 32 bit SolveSpace with --large-address-aware which allows it to access
108-
# up to 3GB on a properly configured 32 bit Windows and up to 4GB on 64 bit.
109-
# See https://msdn.microsoft.com/en-us/library/aa366778
110-
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--large-address-aware")
107+
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
108+
# Link 32 bit SolveSpace with --large-address-aware which allows it to access
109+
# up to 3GB on a properly configured 32 bit Windows and up to 4GB on 64 bit.
110+
# See https://msdn.microsoft.com/en-us/library/aa366778
111+
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--large-address-aware")
112+
endif()
111113
endif()
112114

113115
# Ensure that all platforms use 64-bit IEEE floating point operations for consistency;

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,19 +307,34 @@ nmake
307307
It is also possible to build SolveSpace using [MinGW][mingw], though
308308
Space Navigator support will be disabled.
309309

310-
First, ensure that git and gcc are in your `$PATH`. Then, run the following
311-
in bash:
310+
The easiest way to build using MinGW is with [MSYS2][msys2]. If you're not using MSYS2, skip
311+
the installation instructions and ensure that git, cmake, ninja, and gcc are in your `$PATH`.
312+
313+
With MSYS2, you can build either a 32-bit binary or a 64-bit one, depending on the compiler
314+
used. The following instructions assume you're running the commands inside an `MSYS2 MINGW64`
315+
terminal window and building a 64-bit version. If you want to build a 32-bit version, you'll
316+
need to run the commands in an `MSYS2 MINGW32` terminal window and replace `x86_64`
317+
with `i686` in the installation commands.
318+
319+
First, install Git, GCC, CMake, and Ninja:
320+
321+
```sh
322+
pacman -Sy mingw-w64-x86_64-git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
323+
```
324+
325+
Then, run the following in bash:
312326

313327
```sh
314328
mkdir build
315329
cd build
316-
cmake .. -DCMAKE_BUILD_TYPE=Release
317-
make
330+
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja
331+
ninja
318332
```
319333

320334
[gitwin]: https://git-scm.com/download/win
321-
[cmakewin]: http://www.cmake.org/download/#latest
335+
[cmakewin]: https://www.cmake.org/download/#latest
322336
[mingw]: http://www.mingw.org/
337+
[msys2]: https://www.msys2.org/
323338

324339
## Contributing
325340

extlib/angle

0 commit comments

Comments
 (0)