File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11setlocal
22
3+ IF %platform% == MinGW GOTO build_mingw
34IF %language% == cpp GOTO build_cpp
45IF %language% == csharp GOTO build_csharp
56
6- echo Unsupported language %language% . Exiting.
7+ echo Unsupported language %language% and platform %platform% . Exiting.
78goto :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
1022echo Building C++
1123mkdir build_msvc
Original file line number Diff line number Diff line change 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-
74configuration :
85 - Debug
96
107environment :
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
2730before_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
Original file line number Diff line number Diff 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 >" )
205205endif ()
206206
207+ if (MINGW)
208+ set_source_files_properties (${tests_files} PROPERTIES COMPILE_FLAGS "-Wno-narrowing" )
209+ endif ()
210+
207211add_executable (tests ${tests_files} ${common_test_files} ${tests_proto_files} ${lite_test_proto_files} )
208212target_link_libraries (tests libprotoc libprotobuf gmock_main )
209213
You can’t perform that action at this time.
0 commit comments