Skip to content

Commit

Permalink
refs #5 Компилируемость под Виндой
Browse files Browse the repository at this point in the history
  • Loading branch information
izvolov committed Aug 15, 2019
1 parent 2213529 commit b315efe
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 20 deletions.
25 changes: 25 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '{build}'

image: Visual Studio 2017

platform:
- x86
- x64

environment:
matrix:
- BUILD_TYPE: "Debug"
- BUILD_TYPE: "Release"

install:
- git clone https://github.com/onqtam/doctest.git third_party\doctest
- git -C third_party\doctest checkout 2.3.3
- cmake -S third_party\doctest -B Build\third_party\doctest -DCMAKE_BUILD_TYPE=Release -DDOCTEST_WITH_TESTS=OFF
- cmake --build Build\third_party\doctest --target install

build_script:
- cmake -S . -B Build\mylib -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- cmake --build Build\mylib

test_script:
- cmake --build Build\mylib --target check
44 changes: 24 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,30 @@ option(MYLIB_COVERAGE "Включить измерение покрытия ко
##
###################################################################################################

add_compile_options(
-Werror

-Wall
-Wextra
-Wpedantic

-Wcast-align
-Wcast-qual
-Wconversion
-Wctor-dtor-privacy
-Wenum-compare
-Wfloat-equal
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wredundant-decls
-Wsign-conversion
-Wsign-promo
)
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
add_compile_options(
-Werror

-Wall
-Wextra
-Wpedantic

-Wcast-align
-Wcast-qual
-Wconversion
-Wctor-dtor-privacy
-Wenum-compare
-Wfloat-equal
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wredundant-decls
-Wsign-conversion
-Wsign-promo
)
elseif(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
add_compile_options(/W4 /WX)
endif()

if(NOT CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down

0 comments on commit b315efe

Please sign in to comment.