Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit49fbfc2

Browse files
authored
Add VCPKG usage to GitHub Actions (#167)
1 parent2c7f6d8 commit49fbfc2

File tree

5 files changed

+116
-17
lines changed

5 files changed

+116
-17
lines changed

‎.github/workflows/main.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
matrix:
3030
os:[windows-2019, windows-2022]
31-
build_type:[x64-Debug, x64-Release, x64-Debug-Clang, x64-Release-Clang]
31+
build_type:[x64-Debug, x64-Release]
3232
arch:[amd64]
3333
include:
3434
-os:windows-2019
@@ -37,18 +37,18 @@ jobs:
3737
-os:windows-2019
3838
build_type:x86-Release
3939
arch:amd64_x86
40-
-os:windows-2019
41-
build_type:x86-Debug-Clang
42-
arch:amd64_x86
43-
-os:windows-2019
44-
build_type:x86-Release-Clang
45-
arch:amd64_x86
4640
-os:windows-2022
4741
build_type:x86-Debug
4842
arch:amd64_x86
4943
-os:windows-2022
5044
build_type:x86-Release
5145
arch:amd64_x86
46+
-os:windows-2022
47+
build_type:x64-Debug-Clang
48+
arch:amd64
49+
-os:windows-2022
50+
build_type:x64-Release-Clang
51+
arch:amd64
5252
-os:windows-2022
5353
build_type:x86-Debug-Clang
5454
arch:amd64_x86

‎.github/workflows/test.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
matrix:
3535
os:[windows-2019, windows-2022]
36-
build_type:[x64-Debug, x64-Release, x64-Debug-Clang, x64-Release-Clang]
36+
build_type:[x64-Debug, x64-Release]
3737
arch:[amd64]
3838
include:
3939
-os:windows-2019
@@ -54,6 +54,9 @@ jobs:
5454
-os:windows-2022
5555
build_type:x86-Release
5656
arch:amd64_x86
57+
-os:windows-2022
58+
build_type:x64-Release-Clang
59+
arch:amd64
5760
-os:windows-2022
5861
build_type:x86-Debug-Clang
5962
arch:amd64_x86
@@ -76,6 +79,7 @@ jobs:
7679
# Exclude failing case due to linker issue.
7780
-os:windows-2022
7881
build_type:x64-Debug-Clang
82+
arch:amd64
7983

8084
steps:
8185
-uses:actions/checkout@v4
@@ -125,13 +129,13 @@ jobs:
125129
with:
126130
runVcpkgInstall:true
127131
vcpkgJsonGlob:'**/build/vcpkg.json'
128-
vcpkgGitCommitId:'cacf5994341f27e9a14a7b8724b0634b138ecb30'
132+
vcpkgGitCommitId:'7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
129133

130134
-name:'Configure CMake'
131135
working-directory:${{ github.workspace }}
132136
shell:pwsh
133137
run:>
134-
cmake --preset=${{ matrix.build_type }} -DBUILD_TOOLS=ON -DBUILD_TESTING=ON
138+
cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON
135139
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build"
136140
-DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}"
137141

‎.github/workflows/vcpkg.yml‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
#
4+
# http://go.microsoft.com/fwlink/?LinkID=512686
5+
6+
name:'CMake (Windows using VCPKG)'
7+
8+
on:
9+
push:
10+
branches:[ "main" ]
11+
pull_request:
12+
branches:[ "main" ]
13+
paths-ignore:
14+
-'*.md'
15+
-LICENSE
16+
-build/*
17+
18+
jobs:
19+
build:
20+
runs-on:${{ matrix.os }}
21+
22+
strategy:
23+
fail-fast:false
24+
25+
matrix:
26+
os:[windows-2019, windows-2022]
27+
build_type:[x64-Debug-VCPKG]
28+
arch:[amd64]
29+
include:
30+
-os:windows-2022
31+
build_type:x86-Debug-VCPKG
32+
arch:amd64_x86
33+
-os:windows-2022
34+
build_type:arm64-Debug-VCPKG
35+
arch:amd64_arm64
36+
exclude:
37+
# Exclude failing case due to linker issue.
38+
-os:windows-2022
39+
build_type:x64-Debug-Clang-VCPKG
40+
arch:amd64
41+
42+
steps:
43+
-uses:actions/checkout@v4
44+
45+
-name:'Install Ninja'
46+
run:choco install ninja
47+
48+
-uses:ilammy/msvc-dev-cmd@v1
49+
with:
50+
arch:${{ matrix.arch }}
51+
52+
-name:'Set triplet'
53+
shell:pwsh
54+
run:|
55+
if ("${{ matrix.arch }}" -eq "amd64")
56+
{
57+
echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $env:GITHUB_ENV
58+
}
59+
elseif ("${{ matrix.arch }}" -eq "amd64_x86")
60+
{
61+
echo "VCPKG_DEFAULT_TRIPLET=x86-windows" >> $env:GITHUB_ENV
62+
}
63+
elseif ("${{ matrix.arch }}" -eq "amd64_arm64")
64+
{
65+
if ("${{ matrix.build_type }}" -match "^arm64ec")
66+
{
67+
echo "VCPKG_DEFAULT_TRIPLET=arm64ec-windows" >> $env:GITHUB_ENV
68+
}
69+
else
70+
{
71+
echo "VCPKG_DEFAULT_TRIPLET=arm64-windows" >> $env:GITHUB_ENV
72+
}
73+
}
74+
else
75+
{
76+
echo "::error Unknown architecture/build-type triplet mapping"
77+
}
78+
79+
-uses:lukka/run-vcpkg@v11
80+
with:
81+
runVcpkgInstall:true
82+
vcpkgJsonGlob:'**/build/vcpkg.json'
83+
vcpkgGitCommitId:'7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
84+
85+
-name:'Configure CMake'
86+
working-directory:${{ github.workspace }}
87+
run:>
88+
cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=OFF -DBUILD_TOOLS=ON -DENABLE_USE_EIGEN=ON
89+
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build"
90+
-DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}"
91+
92+
-name:'Build'
93+
working-directory:${{ github.workspace }}
94+
run:cmake --build out\build\${{ matrix.build_type }}

‎CMakePresets.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@
228228
{"name":"arm64-Debug-UWP-Clang" ,"description":"Clang/LLVM for AArch64 (Debug) for UWP","inherits": ["base","ARM64","Debug","Clang","UWP" ],"environment": {"CXXFLAGS":"--target=arm64-pc-windows-msvc" } },
229229
{"name":"arm64-Release-UWP-Clang","description":"Clang/LLVM for AArch64 (Release) for UWP","inherits": ["base","ARM64","Release","Clang","UWP" ],"environment": {"CXXFLAGS":"--target=arm64-pc-windows-msvc" } },
230230

231-
{"name":"x64-Debug-VCPKG-Clang" ,"description":"Clang/LLVM for x64 (Debug) uvatlastool","inherits": ["base","x64","Debug","VCPKG","Clang","Tools" ] },
232-
{"name":"x64-Release-VCPKG-Clang" ,"description":"Clang/LLVM for x64 (Release) uvatlastool","inherits": ["base","x64","Release","VCPKG","Clang","Tools" ] },
233-
{"name":"x86-Debug-VCPKG-Clang" ,"description":"Clang/LLVM for x86 (Debug) uvatlastool","inherits": ["base","x86","Debug","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"-m32" } },
234-
{"name":"x86-Release-VCPKG-Clang" ,"description":"Clang/LLVM for x86 (Release) uvatlastool","inherits": ["base","x86","Release","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"-m32" } },
235-
{"name":"arm64-Debug-VCPKG-Clang" ,"description":"Clang/LLVM for AArch64 (Debug) uvatlastool","inherits": ["base","ARM64","Debug","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"--target=arm64-pc-windows-msvc" } },
236-
{"name":"arm64-Release-VCPKG-Clang","description":"Clang/LLVM for AArch64 (Release) uvatlastool","inherits": ["base","ARM64","Release","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"--target=arm64-pc-windows-msvc" } },
231+
{"name":"x64-Debug-Clang-VCPKG" ,"description":"Clang/LLVM for x64 (Debug) uvatlastool","inherits": ["base","x64","Debug","VCPKG","Clang","Tools" ] },
232+
{"name":"x64-Release-Clang-VCPKG" ,"description":"Clang/LLVM for x64 (Release) uvatlastool","inherits": ["base","x64","Release","VCPKG","Clang","Tools" ] },
233+
{"name":"x86-Debug-Clang-VCPKG" ,"description":"Clang/LLVM for x86 (Debug) uvatlastool","inherits": ["base","x86","Debug","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"-m32" } },
234+
{"name":"x86-Release-Clang-VCPKG" ,"description":"Clang/LLVM for x86 (Release) uvatlastool","inherits": ["base","x86","Release","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"-m32" } },
235+
{"name":"arm64-Debug-Clang-VCPKG" ,"description":"Clang/LLVM for AArch64 (Debug) uvatlastool","inherits": ["base","ARM64","Debug","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"--target=arm64-pc-windows-msvc" } },
236+
{"name":"arm64-Release-Clang-VCPKG","description":"Clang/LLVM for AArch64 (Release) uvatlastool","inherits": ["base","ARM64","Release","VCPKG","Clang","Tools" ],"environment": {"CXXFLAGS":"--target=arm64-pc-windows-msvc" } },
237237

238238
{"name":"x64-Debug-Scarlett-Clang" ,"description":"Clang/LLVM for x64 (Debug) for Xbox Series X|S","inherits": ["base","x64","Debug","Clang","Scarlett" ] },
239239
{"name":"x64-Release-Scarlett-Clang","description":"Clang/LLVM for x64 (Release) for Xbox Series X|S","inherits": ["base","x64","Release","Clang","Scarlett" ] },

‎build/CompilerAndLinker.cmake‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
136136
list(APPEND COMPILER_SWITCHES /Zc:lambda)
137137
endif()
138138

139-
if(CMAKE_CXX_COMPILER_VERSIONVERSION_GREATER_EQUAL 19.29)
139+
if((CMAKE_CXX_COMPILER_VERSIONVERSION_GREATER_EQUAL 19.29)
140+
AND (NOT VCPKG_TOOLCHAIN))
140141
list(APPEND COMPILER_SWITCHES /external:W4)
141142
endif()
142143

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp