Merge pull request #1948 from lazka/cygwin-fix-c99-build
Fix the c99/cmake build under Cygwin/MSYS2
This commit is contained in:
@@ -187,6 +187,9 @@
|
|||||||
version: 1.0.{build}
|
version: 1.0.{build}
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
|
- COMPILER: "gcc"
|
||||||
|
HOST: "cygwin"
|
||||||
|
PLATFORM: "x64"
|
||||||
- COMPILER: "gcc"
|
- COMPILER: "gcc"
|
||||||
HOST: "mingw"
|
HOST: "mingw"
|
||||||
PLATFORM: "x64"
|
PLATFORM: "x64"
|
||||||
@@ -220,6 +223,14 @@
|
|||||||
install:
|
install:
|
||||||
- ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
|
- ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
|
||||||
- SET PATH_ORIGINAL=%PATH%
|
- SET PATH_ORIGINAL=%PATH%
|
||||||
|
- if [%HOST%]==[cygwin] (
|
||||||
|
ECHO Installing Cygwin Packages &&
|
||||||
|
C:\cygwin64\setup-x86_64.exe -qnNdO -R "C:\cygwin64" -g -P ^
|
||||||
|
gcc-g++,^
|
||||||
|
gcc,^
|
||||||
|
cmake,^
|
||||||
|
make
|
||||||
|
)
|
||||||
- if [%HOST%]==[mingw] (
|
- if [%HOST%]==[mingw] (
|
||||||
SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" &&
|
SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" &&
|
||||||
SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" &&
|
SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" &&
|
||||||
@@ -232,6 +243,16 @@
|
|||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION%
|
- ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION%
|
||||||
|
- if [%HOST%]==[cygwin] (
|
||||||
|
set CHERE_INVOKING=yes &&
|
||||||
|
set CC=%COMPILER% &&
|
||||||
|
C:\cygwin64\bin\bash --login -c "
|
||||||
|
set -e;
|
||||||
|
cd build/cmake;
|
||||||
|
CFLAGS='-Werror' cmake -G 'Unix Makefiles' .;
|
||||||
|
make -j4;
|
||||||
|
"
|
||||||
|
)
|
||||||
- if [%HOST%]==[mingw] (
|
- if [%HOST%]==[mingw] (
|
||||||
( if [%PLATFORM%]==[x64] (
|
( if [%PLATFORM%]==[x64] (
|
||||||
SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%"
|
SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%"
|
||||||
|
|||||||
+4
-4
@@ -90,7 +90,7 @@ extern "C" {
|
|||||||
&& ( defined(__unix__) || defined(__unix) \
|
&& ( defined(__unix__) || defined(__unix) \
|
||||||
|| defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) )
|
|| defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) )
|
||||||
|
|
||||||
# if defined(__linux__) || defined(__linux)
|
# if defined(__linux__) || defined(__linux) || defined(__CYGWIN__)
|
||||||
# ifndef _POSIX_C_SOURCE
|
# ifndef _POSIX_C_SOURCE
|
||||||
# define _POSIX_C_SOURCE 200809L /* feature test macro : https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html */
|
# define _POSIX_C_SOURCE 200809L /* feature test macro : https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html */
|
||||||
# endif
|
# endif
|
||||||
@@ -123,11 +123,11 @@ extern "C" {
|
|||||||
************************************************/
|
************************************************/
|
||||||
#if (defined(__linux__) && (PLATFORM_POSIX_VERSION > 1)) \
|
#if (defined(__linux__) && (PLATFORM_POSIX_VERSION > 1)) \
|
||||||
|| (PLATFORM_POSIX_VERSION >= 200112L) \
|
|| (PLATFORM_POSIX_VERSION >= 200112L) \
|
||||||
|| defined(__DJGPP__) \
|
|| defined(__DJGPP__)
|
||||||
|| defined(__MSYS__)
|
|
||||||
# include <unistd.h> /* isatty */
|
# include <unistd.h> /* isatty */
|
||||||
|
# include <stdio.h> /* fileno */
|
||||||
# define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
|
# define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
|
||||||
#elif defined(MSDOS) || defined(OS2) || defined(__CYGWIN__)
|
#elif defined(MSDOS) || defined(OS2)
|
||||||
# include <io.h> /* _isatty */
|
# include <io.h> /* _isatty */
|
||||||
# define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
|
# define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
|
||||||
#elif defined(WIN32) || defined(_WIN32)
|
#elif defined(WIN32) || defined(_WIN32)
|
||||||
|
|||||||
Reference in New Issue
Block a user