Unverified Commit 9694c373 authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #660 from chronoxor/master

MinGW 7.2 (x86_64) build failed
parents 3529a6ee ab4dae82
#! /usr/bin/env bash
cmake -Hc++ -B./build-cygwin -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=./capnproto-c++-cygwin
cmake --build ./build-cygwin --config debug --target install -- -j2
...@@ -50,11 +50,15 @@ environment: ...@@ -50,11 +50,15 @@ environment:
BUILD_NAME: mingw BUILD_NAME: mingw
EXTRA_BUILD_FLAGS: -j2 EXTRA_BUILD_FLAGS: -j2
- BUILD_NAME: cygwin
install: install:
- if not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%" - if not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%"
- 7z x -y "%MINGW_ARCHIVE%" > nul - 7z x -y "%MINGW_ARCHIVE%" > nul
- ps: Get-Command sh.exe -All | Remove-Item - ps: Get-Command sh.exe -All | Remove-Item
# CMake refuses to generate MinGW Makefiles if sh.exe is in the PATH # CMake refuses to generate MinGW Makefiles if sh.exe is in the PATH
- if "%BUILD_NAME%"=="cygwin" appveyor DownloadFile "http://cygwin.com/setup-x86_64.exe" -FileName "C:\cygwin64\setup-x86_64.exe"
- if "%BUILD_NAME%"=="cygwin" C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --root "C:\cygwin64" --packages cmake
before_build: before_build:
- set PATH=%CD%\%MINGW_DIR%\bin;%PATH% - set PATH=%CD%\%MINGW_DIR%\bin;%PATH%
...@@ -64,24 +68,21 @@ before_build: ...@@ -64,24 +68,21 @@ before_build:
build_script: build_script:
- echo "Building Cap'n Proto with %CMAKE_GENERATOR%" - echo "Building Cap'n Proto with %CMAKE_GENERATOR%"
- >- - if NOT "%BUILD_NAME%"=="cygwin" cmake -Hc++ -B%BUILD_DIR% -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%
cmake -Hc++ -B%BUILD_DIR% -G "%CMAKE_GENERATOR%" - if NOT "%BUILD_NAME%"=="cygwin" cmake --build %BUILD_DIR% --config %BUILD_TYPE% --target install -- %EXTRA_BUILD_FLAGS%
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%
-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%
- cmake --build %BUILD_DIR% --config %BUILD_TYPE% --target install -- %EXTRA_BUILD_FLAGS%
# MinGW wants the build type at configure-time while MSVC wants the build type at build-time. We # MinGW wants the build type at configure-time while MSVC wants the build type at build-time. We
# can satisfy both by passing the build type to both cmake invocations. We have to suffer a # can satisfy both by passing the build type to both cmake invocations. We have to suffer a
# warning, but both generators will work. # warning, but both generators will work.
- echo "Building Cap'n Proto samples with %CMAKE_GENERATOR%" - echo "Building Cap'n Proto samples with %CMAKE_GENERATOR%"
- >- - if NOT "%BUILD_NAME%"=="cygwin" cmake -Hc++/samples -B%BUILD_DIR%-samples -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_PREFIX_PATH=%INSTALL_PREFIX%
cmake -Hc++/samples -B%BUILD_DIR%-samples -G "%CMAKE_GENERATOR%" - if NOT "%BUILD_NAME%"=="cygwin" cmake --build %BUILD_DIR%-samples --config %BUILD_TYPE%
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%
-DCMAKE_PREFIX_PATH=%INSTALL_PREFIX% # Cygwin build
- cmake --build %BUILD_DIR%-samples --config %BUILD_TYPE% - if "%BUILD_NAME%"=="cygwin" C:\cygwin64\bin\bash -lc 'cd /cygdrive/c/projects/capnproto; ./appveyor-cygwin.sh'
test_script: test_script:
- timeout /t 2 - timeout /t 2
# Sleep a little to prevent interleaving test output with build output. # Sleep a little to prevent interleaving test output with build output.
- cd %BUILD_DIR%\src - cd %BUILD_DIR%\src
- ctest -V -C %BUILD_TYPE% - if NOT "%BUILD_NAME%"=="cygwin" ctest -V -C %BUILD_TYPE%
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "lexer.h" #include "lexer.h"
#include "parser.h" #include "parser.h"
#include "compiler.h" #include "compiler.h"
......
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
// This program is a code generator plugin for `capnp compile` which writes the schema back to // This program is a code generator plugin for `capnp compile` which writes the schema back to
// stdout in roughly capnpc format. // stdout in roughly capnpc format.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <capnp/schema.capnp.h> #include <capnp/schema.capnp.h>
#include "../serialize.h" #include "../serialize.h"
#include <kj/debug.h> #include <kj/debug.h>
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
// the types are expected to be compatible, the test also constructs an instance of the old // the types are expected to be compatible, the test also constructs an instance of the old
// type and reads it as the new type, and vice versa. // type and reads it as the new type, and vice versa.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <capnp/compiler/grammar.capnp.h> #include <capnp/compiler/grammar.capnp.h>
#include <capnp/schema-loader.h> #include <capnp/schema-loader.h>
#include <capnp/message.h> #include <capnp/message.h>
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <capnp/test-import.capnp.h> #include <capnp/test-import.capnp.h>
#include <capnp/test-import2.capnp.h> #include <capnp/test-import2.capnp.h>
#include "message.h" #include "message.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "serialize-async.h" #include "serialize-async.h"
#include "serialize.h" #include "serialize.h"
#include <kj/debug.h> #include <kj/debug.h>
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "serialize.h" #include "serialize.h"
#include <kj/debug.h> #include <kj/debug.h>
#include <kj/compat/gtest.h> #include <kj/compat/gtest.h>
......
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
#if !_WIN32 #if !_WIN32
// For Win32 implementation, see async-io-win32.c++. // For Win32 implementation, see async-io-win32.c++.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "async-io.h" #include "async-io.h"
#include "async-io-internal.h" #include "async-io-internal.h"
#include "async-unix.h" #include "async-unix.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "debug.h" #include "debug.h"
#include "exception.h" #include "exception.h"
#include <kj/compat/gtest.h> #include <kj/compat/gtest.h>
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "exception.h" #include "exception.h"
#include "string.h" #include "string.h"
#include "debug.h" #include "debug.h"
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
#if !_WIN32 #if !_WIN32
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "filesystem.h" #include "filesystem.h"
#include "debug.h" #include "debug.h"
#include <sys/types.h> #include <sys/types.h>
...@@ -385,8 +389,8 @@ public: ...@@ -385,8 +389,8 @@ public:
static const byte ZEROS[4096] = { 0 }; static const byte ZEROS[4096] = { 0 };
#if __APPLE__ #if __APPLE__ || __CYGWIN__
// Mac doesn't have pwritev(). // Mac & Cygwin doesn't have pwritev().
while (size > sizeof(ZEROS)) { while (size > sizeof(ZEROS)) {
write(offset, ZEROS); write(offset, ZEROS);
size -= sizeof(ZEROS); size -= sizeof(ZEROS);
......
...@@ -1094,7 +1094,7 @@ public: ...@@ -1094,7 +1094,7 @@ public:
} }
KJ_DEFER({ KJ_DEFER({
if (kj::isSameType<T, Directory>()) { if (kj::isSameType<T, Directory>()) {
HANDLE newHandle; HANDLE newHandle = nullptr;
KJ_WIN32(newHandle = CreateFileW( KJ_WIN32(newHandle = CreateFileW(
committed ? parentDirectory.nativePath(path).begin() : tempPath.begin(), committed ? parentDirectory.nativePath(path).begin() : tempPath.begin(),
GENERIC_READ, GENERIC_READ,
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "io.h" #include "io.h"
#include "debug.h" #include "debug.h"
#include "miniposix.h" #include "miniposix.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "io.h" #include "io.h"
#include "debug.h" #include "debug.h"
#include "miniposix.h" #include "miniposix.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "main.h" #include "main.h"
#include "debug.h" #include "debug.h"
#include "arena.h" #include "arena.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "test.h" #include "test.h"
#include "main.h" #include "main.h"
#include "io.h" #include "io.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment