From 15e4d44f11481dc43ca6ec5b5448839cb712330f Mon Sep 17 00:00:00 2001 From: Zhihao Yuan Date: Tue, 12 May 2020 21:49:22 -0500 Subject: [PATCH] Avoid use of cmd.exe in Travis --- .travis.yml | 5 +++-- test/CMakeLists.txt | 1 - tools/build.bat | 4 ++++ tools/build.sh | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 tools/build.bat create mode 100644 tools/build.sh diff --git a/.travis.yml b/.travis.yml index 01c6545e..620daeb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,13 +26,14 @@ install: export PATH=~/Library/Python/3.7/bin:$PATH pip3 install --user ninja cmake else + pipenv global 3.6 pip install --user ninja cmake fi script: - | 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 - cmake -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DARGPARSE_BUILD_TESTS=ON && ninja -C build + sh tools/build.sh fi - ./build/test/tests diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a1f4c82f..921297fc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.6) -project(ARGPARSE) if(MSVC) # Force to always compile with W4 diff --git a/tools/build.bat b/tools/build.bat new file mode 100644 index 00000000..47c24c20 --- /dev/null +++ b/tools/build.bat @@ -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 diff --git a/tools/build.sh b/tools/build.sh new file mode 100644 index 00000000..289d97c8 --- /dev/null +++ b/tools/build.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DARGPARSE_BUILD_TESTS=ON +ninja -C build