Avoid use of cmd.exe in Travis

This commit is contained in:
Zhihao Yuan 2020-05-12 21:49:22 -05:00
parent 33101e7972
commit 15e4d44f11
No known key found for this signature in database
GPG Key ID: A2E474BDAA37E11C
4 changed files with 11 additions and 3 deletions

View File

@ -26,13 +26,14 @@ install:
export PATH=~/Library/Python/3.7/bin:$PATH export PATH=~/Library/Python/3.7/bin:$PATH
pip3 install --user ninja cmake pip3 install --user ninja cmake
else else
pipenv global 3.6
pip install --user ninja cmake pip install --user ninja cmake
fi fi
script: script:
- | - |
if [[ $TRAVIS_OS_NAME == 'windows' ]]; then if [[ $TRAVIS_OS_NAME == 'windows' ]]; then
cmd.exe /C '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 && cmake -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DARGPARSE_BUILD_TESTS=ON && ninja -C build' tools/build.bat
else else
cmake -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DARGPARSE_BUILD_TESTS=ON && ninja -C build sh tools/build.sh
fi fi
- ./build/test/tests - ./build/test/tests

View File

@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.6) cmake_minimum_required(VERSION 3.6)
project(ARGPARSE)
if(MSVC) if(MSVC)
# Force to always compile with W4 # Force to always compile with W4

4
tools/build.bat Normal file
View File

@ -0,0 +1,4 @@
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DARGPARSE_BUILD_TESTS=ON
ninja -C build

4
tools/build.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DARGPARSE_BUILD_TESTS=ON
ninja -C build