-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add windows ci. * Don't build shared libraries. * Use dynamic gtest. * Change target. * Run cmake tests on windows. * Invoke tests.
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
$ErrorActionPreference = "Stop"; | ||
trap { $host.SetShouldExit(1) } | ||
|
||
$action = $args[0] | ||
|
||
$SRC_DIR=(Get-Item -Path ".\").FullName | ||
mkdir build | ||
$BUILD_DIR="$SRC_DIR\build" | ||
$VCPKG_DIR="$SRC_DIR\vcpkg" | ||
|
||
switch ($action) { | ||
"cmake.test" { | ||
cd "$BUILD_DIR" | ||
cmake $SRC_DIR ` | ||
-DVCPKG_TARGET_TRIPLET=x64-windows ` | ||
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR\scripts\buildsystems\vcpkg.cmake" | ||
$exit = $LASTEXITCODE | ||
if ($exit -ne 0) { | ||
exit $exit | ||
} | ||
cmake --build . | ||
$exit = $LASTEXITCODE | ||
if ($exit -ne 0) { | ||
exit $exit | ||
} | ||
ctest -C Debug | ||
$exit = $LASTEXITCODE | ||
if ($exit -ne 0) { | ||
exit $exit | ||
} | ||
} | ||
default { | ||
echo "unknown action: $action" | ||
exit 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$ErrorActionPreference = "Stop" | ||
trap { $host.SetShouldExit(1) } | ||
|
||
git clone https://github.com/Microsoft/vcpkg.git | ||
cd vcpkg | ||
$VCPKG_DIR=(Get-Item -Path ".\").FullName | ||
./bootstrap-vcpkg.bat | ||
./vcpkg integrate install | ||
./vcpkg install gtest:x64-windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$ErrorActionPreference = "Stop" | ||
trap { $host.SetShouldExit(1) } | ||
|
||
$CMAKE_VERSION="3.15.2" | ||
$CWD=(Get-Item -Path ".\").FullName | ||
(new-object System.Net.WebClient). ` | ||
DownloadFile("https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-win64-x64.zip", ` | ||
"$CWD\cmake-$CMAKE_VERSION-win64-x64.zip") | ||
|
||
unzip cmake-$CMAKE_VERSION-win64-x64.zip | ||
|
||
$ENV:PATH="$ENV:PATH;$CWD\cmake-$CMAKE_VERSION-win64-x64\bin" | ||
cmake --help | ||
[Environment]::SetEnvironmentVariable( | ||
"Path", | ||
[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";$CWD\cmake-$CMAKE_VERSION-win64-x64\bin", | ||
[EnvironmentVariableTarget]::Machine) |