Skip to content

Commit feb183d

Browse files
committed
Appveyor MinGW build
1 parent 92898e9 commit feb183d

3 files changed

Lines changed: 26 additions & 6 deletions

File tree

appveyor.bat

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
setlocal
22

3+
IF %platform%==MinGW GOTO build_mingw
34
IF %language%==cpp GOTO build_cpp
45
IF %language%==csharp GOTO build_csharp
56

6-
echo Unsupported language %language%. Exiting.
7+
echo Unsupported language %language% and platform %platform%. Exiting.
78
goto :error
89

10+
:build_mingw
11+
echo Building MinGW
12+
set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=%
13+
mkdir build_mingw
14+
cd build_mingw
15+
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake
16+
mingw32-make -j8 all || goto error
17+
rem cd %configuration%
18+
rem tests.exe || goto error
19+
goto :EOF
20+
921
:build_cpp
1022
echo Building C++
1123
mkdir build_msvc

appveyor.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# Only test one combination: "Visual Studio 12 + Win64 + Debug + DLL". We can
22
# test more combinations but AppVeyor just takes too long to finish (each
33
# combination takes ~15mins).
4-
platform:
5-
- Win64
6-
74
configuration:
85
- Debug
96

107
environment:
118
matrix:
12-
- language: cpp
9+
- platform: MinGW
10+
language: cpp
11+
image: Visual Studio 2015
12+
13+
- platform: Win64
14+
language: cpp
1315
image: Visual Studio 2015
1416
BUILD_DLL: ON
1517
UNICODE: ON
1618

17-
- language: csharp
19+
- platform: Win64
20+
language: csharp
1821
image: Visual Studio 2017
1922

2023
# Our build scripts run tests automatically; we don't want AppVeyor
@@ -25,6 +28,7 @@ install:
2528
- git submodule update --init --recursive
2629

2730
before_build:
31+
- if %platform%==MinGW set generator=MinGW Makefiles
2832
- if %platform%==Win32 set generator=Visual Studio 14
2933
- if %platform%==Win64 set generator=Visual Studio 14 Win64
3034
- if %platform%==Win32 set vcplatform=Win32

cmake/tests.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ if(protobuf_ABSOLUTE_TEST_PLUGIN_PATH)
204204
add_compile_options(-DGOOGLE_PROTOBUF_TEST_PLUGIN_PATH="$<TARGET_FILE:test_plugin>")
205205
endif()
206206

207+
if(MINGW)
208+
set_source_files_properties(${tests_files} PROPERTIES COMPILE_FLAGS "-Wno-narrowing")
209+
endif()
210+
207211
add_executable(tests ${tests_files} ${common_test_files} ${tests_proto_files} ${lite_test_proto_files})
208212
target_link_libraries(tests libprotoc libprotobuf gmock_main)
209213

0 commit comments

Comments
 (0)