From 1baf5eabdf6b5b235ee7308f552d2e19d197322e Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Sun, 4 Feb 2018 00:04:23 -0500 Subject: [PATCH] added minimal support for cmake build in appveyor CI --- .travis.yml | 3 +-- CMakeLists.txt | 21 ++++++++++++++++++--- appveyor.yml | 9 +++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 11c4a515a..2fb8a1de0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -228,8 +228,7 @@ script: - cd .. # minimal support for cmake build - - mkdir build - - cd build + - mkdir build && cd build - if [[ "$cmake" == "1" ]]; then export CXX=g++-5 && export CC=gcc-5 && diff --git a/CMakeLists.txt b/CMakeLists.txt index 980bb9b9a..f1794e6f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -490,9 +490,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Clang) -Wno-global-constructors -Wno-exit-time-destructors -Wno-weak-vtables) -endif() - -if(CMAKE_CXX_COMPILER_ID MATCHES GNU) +elseif(CMAKE_CXX_COMPILER_ID MATCHES GNU) add_compile_options( -Wall -Wextra @@ -502,6 +500,23 @@ if(CMAKE_CXX_COMPILER_ID MATCHES GNU) -Wc++11-compat -Wno-format-zero-length -ftemplate-depth=512) +elseif(MSVC) + add_compile_options( + /W4 + # C4251: 'identifier' : class 'type' needs to have dll-interface to be + # used by clients of class 'type2' + /wd4251 + # C4275: non DLL-interface classkey 'identifier' used as base for + # DLL-interface classkey 'identifier' + /wd4275 + # C4373: virtual function overrides, previous versions of the compiler + # did not override when parameters only differed by const/volatile qualifiers + /wd4373 + # C4268: 'identifier' : 'const' static/global data initialized + # with compiler generated default constructor fills the object with zeros + /wd4268 + # C4503: 'identifier': decorated name length exceeded, name was truncated + /wd4503) endif() if (shared) diff --git a/appveyor.yml b/appveyor.yml index 04a365117..b6286c17d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,6 +20,7 @@ environment: model: 64 python: 1 crypto: openssl + cmake: 1 - variant: test_debug compiler: gcc model: 32 @@ -91,6 +92,14 @@ build_script: b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=off picker-debugging=on invariant-checks=full test_debug %linkflags% %include% boost-link=default link=static crypto=built-in define=BOOST_ASIO_DISABLE_IOCP testing.execute=off ) +# minimal support for cmake build +- cd %ROOT_DIRECTORY% +- mkdir build && cd build +- if defined cmake ( + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="/WX" -G "Visual Studio 14 2015 Win64" .. && + cmake --build . + ) + test_script: - cd %ROOT_DIRECTORY%\test - appveyor-retry b2.exe -l400 --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% win-tests