change build param

This commit is contained in:
Terik23 2018-03-28 13:54:21 +05:00
parent 6a06a0f5af
commit 441412ab7c
5 changed files with 17 additions and 7 deletions

View file

@ -12,11 +12,10 @@ compiler:
- clang++
env:
- TARGET_CPU=amd64 BUILD_CONFIGURATION=Release
- PLATFORM=x64 CONFIGURATION=Release
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_CONFIGURATION -DTARGET_CPU=$TARGET_CPU
- cmake .. -DCMAKE_BUILD_TYPE=$CONFIGURATION -DTARGET_CPU=$PLATFORM
- cmake --build .
- ctest -V --output-on-failure -С $BUILD_CONFIGURATION
- ctest -V --output-on-failure -С $CONFIGURATION

View file

@ -4,7 +4,15 @@ project(nameof)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
enable_testing()
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
add_compile_options(-pedantic)
add_compile_options(-Wall)
add_compile_options(-Wextra)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/W4)
endif()
add_subdirectory(example)
enable_testing()
add_subdirectory(test)

View file

@ -31,7 +31,8 @@ init:
before_build:
- ps: 'Write-Host "Running $env:BUILDER with $env:GENERATOR" -ForegroundColor Magenta'
- if "%BUILDER%"=="CMake" cmake.exe -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% %APPVEYOR_BUILD_FOLDER%
- cd build
- if "%BUILDER%"=="CMake" cmake.exe .. -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DTARGET_CPU=$PLATFORM
build_script:
- ps: 'Write-Host "Running $env:BUILDER:" -ForegroundColor Magenta'

1
build/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*

View file

@ -102,7 +102,8 @@ void TestCase2() {
};
try {
int z = div(10, 0);
const int z = div(10, 0);
std::cout << z << std::endl;
} catch (const std::exception& e) {
std::cout << e.what() << std::endl; // y should not be zero!
}