|
1 | | -# ------------------------------------------------------------------------------ |
| 1 | +# -------------------------- |
2 | 2 | # Cross-compiling with MinGW |
3 | | -# ------------------------------------------------------------------------------ |
4 | | -# Use the commands below to build the Windows version of Open Surge with MinGW: |
| 3 | +# -------------------------- |
| 4 | +# Use the commands below to build the 32-bit Windows version of Open Surge with MinGW: |
5 | 5 | # |
6 | | -# $ mkdir build && cd build |
7 | | -# $ cmake .. \ |
| 6 | +# mkdir build && cd build |
| 7 | +# cmake .. \ |
8 | 8 | # -DCMAKE_TOOLCHAIN_FILE=../src/misc/toolchain-mingw.cmake |
9 | | -# $ make && sudo make install |
| 9 | +# make && sudo make install |
10 | 10 | # |
11 | 11 | # This is for cross-compiling only. |
12 | | -# ------------------------------------------------------------------------------ |
13 | 12 |
|
14 | 13 | # Set the system name |
15 | 14 | set(CMAKE_SYSTEM_NAME Windows) |
16 | 15 |
|
| 16 | +# Set the target architecture |
| 17 | +set(CMAKE_SYSTEM_PROCESSOR X86) |
| 18 | + |
17 | 19 | # Set the location of the C compiler and of the target environment (MINGDIR) |
18 | 20 | # The paths below are taken from the Allegro 5 build system; if MinGW isn't |
19 | 21 | # found automatically in your system, please adjust the paths manually: |
20 | | -if(EXISTS /usr/i586-mingw32msvc) |
21 | | - set(CMAKE_C_COMPILER i586-mingw32msvc-gcc) |
22 | | - set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++) |
23 | | - set(CMAKE_RC_COMPILER i586-mingw32msvc-windres) |
24 | | - set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc) |
25 | | -elseif(EXISTS /usr/i686-w64-mingw32) |
| 22 | +if(EXISTS /usr/i686-w64-mingw32) |
26 | 23 | set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) |
27 | 24 | set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) |
28 | 25 | set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) |
29 | 26 | set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) |
30 | 27 | set(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar) |
| 28 | +elseif(EXISTS /usr/i586-mingw32msvc) |
| 29 | + set(CMAKE_C_COMPILER i586-mingw32msvc-gcc) |
| 30 | + set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++) |
| 31 | + set(CMAKE_RC_COMPILER i586-mingw32msvc-windres) |
| 32 | + set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc) |
31 | 33 | elseif(EXISTS /opt/mingw) |
32 | 34 | set(CMAKE_C_COMPILER /opt/mingw/usr/bin/i686-pc-mingw32-gcc) |
33 | 35 | set(CMAKE_CXX_COMPILER /opt/mingw/usr/bin/i686-pc-mingw32-g++) |
|
0 commit comments