Skip to content

Commit f149d26

Browse files
committed
Add optional vcpkg support
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
1 parent b82727f commit f149d26

13 files changed

Lines changed: 56 additions & 0 deletions

File tree

copier.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ add_extension:
5454

5555
_subdirectory: "{{ add_extension }}"
5656

57+
add_vcpkg:
58+
type: bool
59+
default: false
60+
help: Add vcpkg dependency management
61+
when: "{{ add_extension in ['cpp', 'cppjswasm'] }}"
62+
5763
python_version_primary:
5864
type: str
5965
default: 3.11

cpp/.github/workflows/build.yaml.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ jobs:
6161

6262
- uses: actions-ext/cpp/setup@51c484ef64088c62434226039d0e3359f5fc8df6
6363

64+
{% if add_vcpkg -%}
65+
- uses: actions-ext/cpp/setup-vcpkg-cache@6ded4958b7e13d73428138a01d53c33cb941121d
66+
67+
{% endif -%}
6468
- name: Install dependencies
6569
run: make develop
6670

cpp/.gitignore.jinja

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ __pycache__/
1313
*.exp
1414
*.lib
1515

16+
{% if add_vcpkg -%}
17+
# vcpkg
18+
vcpkg/
19+
vcpkg_installed/
20+
21+
{% endif -%}
1622
# Rust
1723
target
1824
target-capi

cpp/pyproject.toml.jinja

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ packages = [
135135
"{{ module }}",
136136
"cpp",
137137
]
138+
{% if add_vcpkg %}
139+
[tool.hatch.build.targets.sdist.force-include]
140+
"vcpkg.json" = "vcpkg.json"
141+
"vcpkg-overlays" = "vcpkg-overlays"
142+
{% endif %}
138143

139144
[tool.hatch.build.targets.wheel]
140145
packages = [
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"dependencies": [],
3+
"configuration": {
4+
"overlay-ports": [
5+
"vcpkg-overlays"
6+
]
7+
}
8+
}

cppjswasm/.github/workflows/build.yaml.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ jobs:
4949

5050
- uses: actions-ext/cpp/setup@51c484ef64088c62434226039d0e3359f5fc8df6
5151

52+
{% if add_vcpkg -%}
53+
- uses: actions-ext/cpp/setup-vcpkg-cache@6ded4958b7e13d73428138a01d53c33cb941121d
54+
55+
{% endif -%}
5256
- uses: mymindstorm/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
5357

5458
- name: Install dependencies

cppjswasm/.gitignore.jinja

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ __pycache__/
1313
*.exp
1414
*.lib
1515

16+
{% if add_vcpkg -%}
17+
# vcpkg
18+
vcpkg/
19+
vcpkg_installed/
20+
21+
{% endif -%}
1622
# Rust
1723
target
1824
target-capi

cppjswasm/pyproject.toml.jinja

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ packages = [
153153
"cpp",
154154
"js",
155155
]
156+
{% if add_vcpkg %}
157+
[tool.hatch.build.targets.sdist.force-include]
158+
"vcpkg.json" = "vcpkg.json"
159+
"vcpkg-overlays" = "vcpkg-overlays"
160+
{% endif %}
156161

157162
[tool.hatch.build.targets.wheel]
158163
packages = [
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)