diff --git a/.travis.yml b/.travis.yml index 8443e5a0..6ef03aa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,6 +111,8 @@ matrix: - tree ./libs allow_failures: # Errors + - env: CXX_COMPILER=g++-4.8 BUILD=Debug STANDARD=11 + compiler: gcc - env: CXX_COMPILER=g++-4.4 BUILD=Debug STANDARD=0x compiler: gcc diff --git a/include/fmt/format.h b/include/fmt/format.h index ce1347b4..cd25ef48 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -49,10 +49,12 @@ # define FMT_CLANG_VERSION 0 #endif -#if defined(__INTEL_COMPILER) +#ifdef __INTEL_COMPILER # define FMT_ICC_VERSION __INTEL_COMPILER #elif defined(__ICL) # define FMT_ICC_VERSION __ICL +#else +# define FMT_ICC_VERSION 0 #endif #ifdef _MSC_VER @@ -73,7 +75,7 @@ # pragma GCC diagnostic ignored "-Wsign-conversion" #endif -#if FMT_CLANG_VERSION && !defined(FMT_ICC_VERSION) +#if FMT_CLANG_VERSION && !FMT_ICC_VERSION # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdocumentation-unknown-command" # pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template" @@ -114,7 +116,7 @@ // For Intel's compiler both it and the system gcc/msc must support UDLs. # if (FMT_HAS_FEATURE(cxx_user_literals) || \ FMT_GCC_VERSION >= 407 || FMT_MSC_VER >= 1900) && \ - (!defined(FMT_ICC_VERSION) || FMT_ICC_VERSION >= 1500) + (!FMT_ICC_VERSION || FMT_ICC_VERSION >= 1500) # define FMT_USE_USER_DEFINED_LITERALS 1 # else # define FMT_USE_USER_DEFINED_LITERALS 0 @@ -1614,6 +1616,11 @@ FMT_CONSTEXPR unsigned parse_nonnegative_int(Iterator &it, ErrorHandler &&eh) { return value; } +#if FMT_MSC_VER +#pragma warning(push) +#pragma warning(disable: 4512) +#endif + template class custom_formatter: public function { private: @@ -1631,6 +1638,10 @@ class custom_formatter: public function { bool operator()(T) const { return false; } }; +#if FMT_MSC_VER +#pragma warning(pop) +#endif + template struct is_integer { enum { diff --git a/support/appveyor-build.py b/support/appveyor-build.py deleted file mode 100755 index cd6324fe..00000000 --- a/support/appveyor-build.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python -# Build the project on AppVeyor. - -import os -from subprocess import check_call - -build = os.environ['BUILD'] -config = os.environ['CONFIGURATION'] -platform = os.environ.get('PLATFORM') -path = os.environ['PATH'] -cmake_command = ['cmake', '-DFMT_PEDANTIC=ON', '-DCMAKE_BUILD_TYPE=' + config] -if build == 'mingw': - cmake_command.append('-GMinGW Makefiles') - build_command = ['mingw32-make', '-j4'] - test_command = ['mingw32-make', 'test'] - # Remove the path to Git bin directory from $PATH because it breaks - # MinGW config. - path = path.replace(r'C:\Program Files (x86)\Git\bin', '') - os.environ['PATH'] = r'C:\MinGW\bin;' + path -else: - # Add MSBuild 14.0 to PATH as described in - # http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc. - os.environ['PATH'] = r'C:\Program Files (x86)\MSBuild\15.0\Bin;' + path - generator = 'Visual Studio 15 2017' - if platform == 'x64': - generator += ' Win64' - cmake_command.append('-G' + generator) - build_command = ['cmake', '--build', '.', '--config', config, '--', '/m:4'] - test_command = ['ctest', '-C', config] - -check_call(cmake_command) -check_call(build_command) -check_call(test_command) diff --git a/support/appveyor.yml b/support/appveyor.yml index d7eb8434..600d71aa 100644 --- a/support/appveyor.yml +++ b/support/appveyor.yml @@ -1,22 +1,49 @@ -configuration: - - Debug - - Release +configuration: Debug -image: Visual Studio 2017 +clone_depth: 1 + +platform: + - Win32 + - x64 environment: CTEST_OUTPUT_ON_FAILURE: 1 + MSVC_DEFAULT_OPTIONS: ON matrix: - - BUILD: msvc - - BUILD: msvc - PLATFORM: x64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + CMAKE_GENERATOR: Visual Studio 12 2013 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CMAKE_GENERATOR: Visual Studio 14 2015 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CMAKE_GENERATOR: Visual Studio 15 2017 + +matrix: + allow_failures: + - image: Visual Studio 2013 + +init: + - ps: | + If ($env:Platform -Match "x64") { + $env:CMAKE_GENERATOR_SUFFIX=" Win64" + } before_build: # Workaround for CMake not wanting sh.exe on PATH for MinGW. - - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% + - ps: | + mkdir build + cd build + + cmake -G "$($env:CMAKE_GENERATOR)$($env:CMAKE_GENERATOR_SUFFIX)" -DFMT_WERROR=OFF -DFMT_PEDANTIC=ON -DCMAKE_BUILD_TYPE=$env:CONFIGURATION .. -build_script: - - python support/appveyor-build.py +build: + project: C:\projects\fmt\build\fmt.sln + parallel: true + verbosity: normal + +test_script: + - ps: | + cd build + ctest -C $env:CONFIGURATION on_failure: - appveyor PushArtifact Testing/Temporary/LastTest.log