[build] Add Windows CMake CI (#5516)

This commit is contained in:
autoantwort
2023-09-18 01:16:52 +02:00
committed by GitHub
parent 34e7849605
commit 25b0622d4c
4 changed files with 38 additions and 2 deletions

View File

@@ -54,3 +54,29 @@ jobs:
- name: test
working-directory: build
run: ctest --output-on-failure
build-windows:
name: "Build - Windows"
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- name: Install CMake
uses: lukka/get-cmake@v3.23.0
- name: Run vcpkg
uses: lukka/run-vcpkg@v11.1
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg
vcpkgGitCommitId: 78b61582c9e093fda56a01ebb654be15a0033897 # HEAD on 2023-08-6
- name: Install jinja
run: python -m pip install jinja2
- name: configure
run: cmake -S . -B build -G "Ninja Multi-Config" -DWITH_JAVA=OFF -DWITH_TESTS=OFF -DUSE_SYSTEM_FMTLIB=ON -DUSE_SYSTEM_LIBUV=ON -DUSE_SYSTEM_EIGEN=ON -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_INSTALL_OPTIONS=--clean-after-build -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release
- name: build
working-directory: build
run: cmake --build . --parallel $(nproc) --config Release

View File

@@ -82,7 +82,7 @@ target_compile_features(apriltag PUBLIC cxx_std_20)
wpilib_target_warnings(apriltag)
# disable warnings that apriltaglib can't handle
if (MSVC)
target_compile_options(apriltag PRIVATE /wd4018)
target_compile_options(apriltag PRIVATE /wd4018 /wd4005 /wd4996)
else()
target_compile_options(apriltag PRIVATE -Wno-sign-compare -Wno-gnu-zero-variadic-macro-arguments -Wno-type-limits)
endif()

View File

@@ -2,6 +2,9 @@
"name": "main",
"version-string": "latest",
"dependencies": [
"opencv"
"opencv",
"eigen3",
"fmt",
"libuv"
]
}

View File

@@ -118,6 +118,13 @@ if (NOT USE_SYSTEM_FMTLIB)
else()
find_package(fmt CONFIG REQUIRED)
target_link_libraries(wpiutil fmt::fmt)
if(MSVC)
get_target_property(fmt_includes fmt::fmt INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir ${fmt_includes})
target_compile_options(wpiutil PUBLIC /external:I "${dir}")
endforeach()
target_compile_options(wpiutil PUBLIC /external:W0)
endif()
endif()
if (MSVC)