mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-25 09:11:58 -05:00
6418b5f4de
* Added c++17 test configurations for clang5.0 and clang6.0 * Fix #739 correct cppcorecheck warnings for clang-cl * Add clang-cl configurations * Corrections Appveyor; Temporarily disable msvc compilation for faster testing (#741) * Add path to clang-cl.exe (#741) * Escape backslash in path (#741) * Update vcpkg (#741) * Check vcpkg version; try without building vcpkg; use latest clang-cl from path (#741) * Fix blocks in ps script (#741) * Try accessing APPVEYOR_BUILD_FOLDER variable (#471) * Update span size() bug confirmation test for GCC 6.5 (#741) * MSVC flags to Clang-cl; disable c++98-compat and undefined macro warnings (#741) * Suppress clang warning on tests (missing-prototypes) (#741) * Fix clang warning -Wnewline-eof (#741) * Fix clang warning -Wdouble-promotion (#741) * Set linker explicitly * Clean condition statement * For Clang, fallback to the AppVeyor installed version of CMake * Fix clang warning -Wmissing-variable-declarations * Fallback to the MSVC linker until vcpkg has been updated * Revert "Fallback to the MSVC linker until vcpkg has been updated" This reverts commit7263f3289e
. * Fix clang warning -Wunused-member-function * Fix clang warning -Wmissing-noreturn * Fix clang warning -Winvalid-noreturn on Windows * Add macro block end comment on large #if blocks * Workaround: fallback to mscv link.exe * Workaround: get msvc paths into PowerShell through intermediate file * Workaround: fix, remove "PATH=" from text * Workaround: try with full-path; and return user PATH * Workaround: fix, escape backslashes * Revert all since "Workaround: fallback to mscv link.exe" did not work on AppVeyor This reverts the commits:bda3d6a428
97062933ac
0f4fb04bac
1b0c19afd1
a5739ea5f0
* Suppress output of git pull; remove vcpkg from cache * Re-enable AppVeyor builds for all platforms * Correct typo Co-Authored-By: Farwaykorse <Farwaykorse@users.noreply.github.com> * Add Clang-cl 7.0.0 to the supported platforms * Revert "Fix clang warning -Wunused-member-function" This reverts commit6fe1a42035
. * Fix or locally suppress clang warning -Wunused-member-function * format touched code and correct comment * git pull --quiet * fix logic error in workaround * fix missing bracket * Suppress output of mkdir * Replace MSBuild with Ninja * Suppress output of 7z * Add architecture flags for Clang * Drop workaround for lld-link * 7-zip Overwrite and Alternative output suppression without suppressing errors Replaces3c1c0794dd
* AppVeyor setup and CMake before build * reorder compiler configuration * remove unnecessary * remove -fno-strict-aliasing * remove -Wsign-conversion, since before v4.0 part of -Wconversion * -Wctor-dtor-privacy is GCC only * remove -Woverloaded-virtual part of -Wmost, part of -Wall * add -Wmissing-noreturn * remove the pragmas for -Wunused-member-function * Re-add MSBuild generator on AppVeyor * Print CMake commands * Add MSBuild toolset selection * Separate Architecture setting * clang-cl: add -Weverything * clang-cl -Wno-c++98-compat * clang-cl -Wno-c++98-compat-pedantic * clang-cl -Wno-missing-prototypes * clang-cl C++14 -Wno-unused-member-function * clang-cl -Wundef __GNUC__ * clang++: add -Weverything * clang++ -Wno-c++98-compat * clang++ -Wno-c++98-compat-pedantic * clang++ -Wno-missing-prototypes * clang++ -Wno-weak-vtables * clang++ C++14 -Wno-unused-member-function * clang++ fix -Wundef _MSC_VER * clang++ -Wno-padded * clang++ solve -Wdeprecated * Add AppleClang compiler target Since CMake v3.0 use of Clang for both is deprecated * clang++ v5.0 C++17 -Wno-undefined-func-template * Add VS2015 + LLVM/clang-cl to AppVeyor * Do not disable constexpr when compiling with clang-cl on Windows * Clean-up clang-only warnings (now under -Weverything) * Revert "Fix clang warning -Winvalid-noreturn on Windows" This reverts commit2238c4760e
. * Suppress -Winvalid-noreturn for the MS STL noexception workaround * CMake: put preprocessor definition in target_compile_definitions * Solve compiler warning C4668: __GNUC__ not defined
123 lines
3.8 KiB
YAML
123 lines
3.8 KiB
YAML
shallow_clone: true
|
|
|
|
platform:
|
|
- x86
|
|
- x64
|
|
|
|
configuration:
|
|
- Debug
|
|
- Release
|
|
|
|
image:
|
|
- Visual Studio 2015
|
|
- Visual Studio 2017
|
|
|
|
environment:
|
|
NINJA_TAG: v1.8.2
|
|
NINJA_SHA512: 9B9CE248240665FCD6404B989F3B3C27ED9682838225E6DC9B67B551774F251E4FF8A207504F941E7C811E7A8BE1945E7BCB94472A335EF15E23A0200A32E6D5
|
|
NINJA_PATH: C:\Tools\ninja\ninja-%NINJA_TAG%
|
|
VCVAR2015: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat'
|
|
VCVAR2017: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'
|
|
matrix:
|
|
- GSL_CXX_STANDARD: 14
|
|
USE_TOOLSET: MSVC
|
|
USE_GENERATOR: MSBuild
|
|
- GSL_CXX_STANDARD: 17
|
|
USE_TOOLSET: MSVC
|
|
USE_GENERATOR: MSBuild
|
|
- GSL_CXX_STANDARD: 14
|
|
USE_TOOLSET: LLVM
|
|
USE_GENERATOR: Ninja
|
|
- GSL_CXX_STANDARD: 17
|
|
USE_TOOLSET: LLVM
|
|
USE_GENERATOR: Ninja
|
|
|
|
matrix:
|
|
exclude:
|
|
- image: Visual Studio 2015
|
|
GSL_CXX_STANDARD: 17
|
|
- image: Visual Studio 2015
|
|
USE_TOOLSET: LLVM
|
|
USE_GENERATOR: MSBuild
|
|
|
|
cache:
|
|
- C:\cmake-3.8.0-win32-x86
|
|
- C:\Tools\ninja
|
|
|
|
install:
|
|
- ps: |
|
|
if (![IO.File]::Exists("$env:NINJA_PATH\ninja.exe")) {
|
|
Start-FileDownload `
|
|
"https://github.com/ninja-build/ninja/releases/download/$env:NINJA_TAG/ninja-win.zip"
|
|
$hash = (Get-FileHash ninja-win.zip -Algorithm SHA512).Hash
|
|
if ($env:NINJA_SHA512 -eq $hash) {
|
|
7z e -y -bso0 ninja-win.zip -o"$env:NINJA_PATH"
|
|
} else { Write-Warning "Ninja download hash changed!"; Write-Output "$hash" }
|
|
}
|
|
if ([IO.File]::Exists("$env:NINJA_PATH\ninja.exe")) {
|
|
$env:PATH = "$env:NINJA_PATH;$env:PATH"
|
|
} else { Write-Warning "Failed to find ninja.exe in expected location." }
|
|
if ($env:USE_TOOLSET -ne "LLVM") {
|
|
if (![IO.File]::Exists("C:\cmake-3.8.0-win32-x86\bin\cmake.exe")) {
|
|
Start-FileDownload 'https://cmake.org/files/v3.8/cmake-3.8.0-win32-x86.zip'
|
|
7z x -y -bso0 cmake-3.8.0-win32-x86.zip -oC:\
|
|
}
|
|
$env:PATH="C:\cmake-3.8.0-win32-x86\bin;$env:PATH"
|
|
}
|
|
|
|
before_build:
|
|
- ps: |
|
|
if ("$env:USE_GENERATOR" -eq "Ninja") {
|
|
$GeneratorFlags = '-k 10'
|
|
$Architecture = $env:PLATFORM
|
|
if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") {
|
|
$env:VCVARSALL = "`"$env:VCVAR2015`" $Architecture"
|
|
} else {
|
|
$env:VCVARSALL = "`"$env:VCVAR2017`" $Architecture"
|
|
}
|
|
$env:CMakeGenFlags = "-G Ninja -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD"
|
|
} else {
|
|
$GeneratorFlags = '/m /v:minimal'
|
|
if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") {
|
|
$Generator = 'Visual Studio 14 2015'
|
|
} else {
|
|
$Generator = 'Visual Studio 15 2017'
|
|
}
|
|
if ("$env:PLATFORM" -eq "x86") {
|
|
$Architecture = "Win32"
|
|
} else {
|
|
$Architecture = "x64"
|
|
}
|
|
if ("$env:USE_TOOLSET" -eq "LLVM") {
|
|
$env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -T llvm -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD"
|
|
} else {
|
|
$env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD"
|
|
}
|
|
}
|
|
if ("$env:USE_TOOLSET" -eq "LLVM") {
|
|
$env:CC = "clang-cl"
|
|
$env:CXX = "clang-cl"
|
|
if ("$env:PLATFORM" -eq "x86") {
|
|
$env:CFLAGS = "-m32";
|
|
$env:CXXFLAGS = "-m32";
|
|
} else {
|
|
$env:CFLAGS = "-m64";
|
|
$env:CXXFLAGS = "-m64";
|
|
}
|
|
}
|
|
$env:CMakeBuildFlags = "--config $env:CONFIGURATION -- $GeneratorFlags"
|
|
- mkdir build
|
|
- cd build
|
|
- if %USE_GENERATOR%==Ninja (call %VCVARSALL%)
|
|
- echo %CMakeGenFlags%
|
|
- cmake .. %CMakeGenFlags%
|
|
|
|
build_script:
|
|
- echo %CMakeBuildFlags%
|
|
- cmake --build . %CMakeBuildFlags%
|
|
|
|
test_script:
|
|
- ctest -j2
|
|
|
|
deploy: off
|