Skip to content

Commit fbe0f42

Browse files
authored
Merge pull request #39 from nayaku/master
Fix compile fails with mingw32-w64-i686 compiler
2 parents c6d02ee + 146268a commit fbe0f42

File tree

3 files changed

+78
-23
lines changed

3 files changed

+78
-23
lines changed

.github/workflows/Tests.yml

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,51 @@ jobs:
66
build-ubuntu:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
with:
11-
submodules: recursive
12-
- name: Install Dependencies
13-
run: sudo apt-get install xorg-dev libglu1-mesa-dev
14-
- name: Configure
15-
run: cmake -B build .
16-
- name: Build
17-
run: cmake --build build
18-
- name: Test
19-
working-directory: build
20-
run: ctest --output-on-failure
9+
- uses: actions/checkout@v2
10+
with:
11+
submodules: recursive
12+
- name: Install Dependencies
13+
run: sudo apt-get install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
14+
- name: Configure
15+
run: cmake -B build .
16+
- name: Build
17+
run: cmake --build build --config Release
18+
- name: Test
19+
working-directory: build
20+
run: ctest --output-on-failure
2121

2222
build-windows:
2323
runs-on: windows-latest
24+
strategy:
25+
fail-fast: false
26+
max-parallel: 1
27+
matrix:
28+
compiler: [mingw-w64,msvc16]
29+
include:
30+
- compiler: mingw-w64
31+
PLATFORM_NAME: "MinGW Makefiles"
32+
- compiler: msvc16
33+
PLATFORM_NAME: "Visual Studio 16 2019"
2434
steps:
25-
- uses: actions/checkout@v2
26-
with:
27-
submodules: recursive
28-
- name: Configure
29-
run: cmake -B build .
30-
- name: Build
31-
run: cmake --build build
32-
- name: Test
33-
run: build\bin\Debug\raylib-lua-sol.exe tests/raylib-lua-sol-tests.lua
35+
- uses: actions/checkout@v2
36+
with:
37+
submodules: recursive
38+
39+
# Setup Visual Studio
40+
- name: Setup MSBuild
41+
uses: microsoft/setup-msbuild@v1.0.2
42+
if: matrix.compiler == 'msvc16'
43+
44+
- name: Configure
45+
run: cmake -G "${{ matrix.platform_name }}" -B build_${{ matrix.compiler }} .
46+
47+
- name: Build
48+
run: cmake --build build_${{ matrix.compiler }} --config Release
49+
50+
- name: Test (mingw-w64)
51+
run: build_${{ matrix.compiler }}\bin\raylib-lua-sol.exe tests/raylib-lua-sol-tests.lua
52+
if: matrix.compiler == 'mingw-w64'
53+
54+
- name: Test (msvc16)
55+
run: build_${{ matrix.compiler }}\bin\Release\raylib-lua-sol.exe tests/raylib-lua-sol-tests.lua
56+
if: matrix.compiler == 'msvc16'

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project (raylib-lua-sol
88
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
99
configure_file(${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake ${CMAKE_BINARY_DIR})
1010

11-
if (WIN32)
11+
if (MSVC)
1212
#add_compile_options("/SUBSYSTEM:WINDOWS")
1313
#add_compile_options("/ENTRY:mainCRTStartup")
1414
#ADD_DEFINITIONS(/bigobj)
@@ -17,6 +17,13 @@ if (WIN32)
1717
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /bigobj")
1818
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj")
1919
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /bigobj")
20+
elseif(MINGW OR CYGWIN)
21+
add_definitions(-O3)
22+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
23+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
24+
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wa,-mbig-obj")
25+
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wa,-mbig-obj")
26+
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Os -Wa,-mbig-obj")
2027
endif()
2128

2229
# Options

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,31 @@ Note that launcher can also be compiled for other platforms, just need to link w
4040
bin/raylib-lua-sol examples/core_basic_window.lua
4141
```
4242

43+
## Prebuild On Windows
44+
45+
Require:
46+
47+
- C Compiler: MinGW([Cygwin](https://cygwin.com/install.html),...) or [Visual Studio](https://visualstudio.microsoft.com/downloads/).
48+
- [CMake](https://cmake.org/download/).
49+
50+
## Prebuild On GNU Linux
51+
52+
```bash
53+
sudo apt install build-essential git cmake
54+
```
55+
56+
### Unbuntu
57+
58+
```bash
59+
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
60+
```
61+
62+
### Fedora
63+
64+
```bash
65+
sudo dnf install alsa-lib-devel mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel
66+
```
67+
4368
## Build
4469

4570
*raylib-lua-sol* uses cmake as a primary development target. Would appreciate adding more project templates, however.
@@ -49,7 +74,7 @@ git clone https://github.com/RobLoach/raylib-lua-sol.git
4974
cd raylib-lua-sol
5075
git submodule update --init
5176
cmake -B build .
52-
cmake --build build
77+
cmake --build build --config Release
5378
```
5479

5580
## Development

0 commit comments

Comments
 (0)