Skip to content

Commit a75eca1

Browse files
committed
WIP
1 parent 2d0efda commit a75eca1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2742
-2986
lines changed

.github/workflows/macos.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,41 @@ on:
1212

1313
env:
1414
CTEST_OUTPUT_ON_FAILURE: 1
15-
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
1615

1716
jobs:
1817
build:
19-
runs-on: macos-latest
18+
runs-on: macos-13
2019

2120
steps:
21+
- name: Set up C++20
22+
uses: actions/setup-cpp@v0.9.4
23+
with:
24+
compiler: gcc
25+
cmake: true
26+
ninja: true
27+
2228
- uses: actions/checkout@v3
2329
with:
2430
submodules: recursive
2531

2632
- uses: actions/cache@v3
2733
with:
28-
path: "**/cpm_modules"
29-
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
34+
path: "build/vcpkg_installed/**/*"
35+
key: ${{ github.workflow }}-vcpkg_installed
3036

3137
- name: install dependencies
3238
run: |
33-
brew install ninja
39+
brew install autoconf autoconf-archive automake coreutils libtool ninja pkg-config
3440
3541
- name: configure
3642
run: |
37-
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Debug
43+
cmake --preset linux-ninja-Debug
3844
3945
- name: build
40-
run: cmake --build build --parallel
46+
run: |
47+
cmake --build --preset linux-ninja-Debug
4148
4249
- name: test
43-
working-directory: build/test
4450
run: |
45-
ctest
51+
./build/test/component-model-test
4652

.github/workflows/ubuntu.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
env:
1414
CTEST_OUTPUT_ON_FAILURE: 1
1515
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
16-
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
1716

1817
jobs:
1918
build:
@@ -26,26 +25,29 @@ jobs:
2625

2726
- uses: actions/cache@v3
2827
with:
29-
path: "**/cpm_modules"
30-
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
28+
path: "build/vcpkg_installed/**/*"
29+
key: ${{ github.workflow }}-vcpkg_installed
3130

3231
- name: install dependencies
3332
run: |
34-
sudo apt-get install ninja-build
33+
sudo apt-get install -y \
34+
autoconf \
35+
autoconf-archive \
36+
automake \
37+
build-essential \
38+
ninja-build
3539
3640
- name: configure
3741
run: |
38-
cmake -G Ninja -S . -B build -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug
39-
40-
- name: build-wasm
41-
run: ./test/wasm/build.sh
42+
cmake --preset linux-ninja-Debug
4243
4344
- name: build
44-
run: cmake --build build --parallel
45+
run: |
46+
cmake --build --preset linux-ninja-Debug
4547
4648
- name: test
4749
run: |
48-
ctest --test-dir ./build/test
50+
./build/test/component-model-test
4951
5052
- name: Upload coverage reports to Codecov
5153
uses: codecov/codecov-action@v4.0.1

.github/workflows/windows.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212

1313
env:
1414
CTEST_OUTPUT_ON_FAILURE: 1
15-
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
1615

1716
jobs:
1817
build:
@@ -25,18 +24,18 @@ jobs:
2524

2625
- uses: actions/cache@v3
2726
with:
28-
path: "**/cpm_modules"
29-
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
27+
path: "build/vcpkg_installed/**/*"
28+
key: ${{ github.workflow }}-vcpkg_installed
3029

3130
- name: configure
3231
run: |
33-
cmake -S . -B build
32+
cmake --preset vcpkg-VS-17
3433
3534
- name: build
36-
run: cmake --build build --config Debug --parallel
35+
run: |
36+
cmake --build --preset VS-17-Debug
3737
3838
- name: test
39-
working-directory: build/test
4039
run: |
41-
ctest
40+
./build/test/Debug/component-model-test.exe
4241

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/build*
2-
/.vscode
2+
/.vscode/settings.json
33
/cpm_modules
44
/vcpkg_installed
5+
/test/wasm/build*
56
.DS_Store

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
url = https://github.com/microsoft/vcpkg.git
44
[submodule "ref/component-model"]
55
path = ref/component-model
6-
url = git@github.com:WebAssembly/component-model.git
6+
url = https://github.com/WebAssembly/component-model.git
7+
[submodule "ref/vscode-wasm"]
8+
path = ref/vscode-wasm
9+
url = git@github.com:microsoft/vscode-wasm.git

.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "(gdb) component-model-tests",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/build/test/component-model-test",
9+
"args": [],
10+
"stopAtEntry": false,
11+
"cwd": "${workspaceFolder}",
12+
"environment": [],
13+
"externalConsole": false,
14+
"preLaunchTask": "CMake: build"
15+
},
16+
{
17+
"name": "(win) component-model-tests",
18+
"type": "cppvsdbg",
19+
"request": "launch",
20+
"program": "${workspaceFolder}/build/test/Debug/component-model-test.exe",
21+
"args": [],
22+
"console": "integratedTerminal",
23+
"stopAtEntry": false,
24+
"cwd": "${workspaceFolder}",
25+
"environment": [],
26+
"preLaunchTask": "CMake: build"
27+
}
28+
]
29+
}

.vscode/tasks.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "CMake: build",
6+
"type": "shell",
7+
"command": "cmake",
8+
"args": [
9+
"--build",
10+
"${workspaceFolder}/build",
11+
"--parallel"
12+
],
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
},
17+
"problemMatcher": "$msCompile"
18+
}
19+
]
20+
}

CMakeLists.txt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
cmake_minimum_required(VERSION 3.14...3.22)
22

3-
set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
4-
set(VCPKG_FILES_DIR "${CMAKE_BINARY_DIR}" CACHE STRING "Folder for vcpkg download, build and installed files")
5-
set(CMAKE_TOOLCHAIN_FILE ${ROOT_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake)
6-
set(VCPKG_ROOT ${ROOT_DIR}/vcpkg)
7-
set(VCPKG_INSTALLED_DIR "${VCPKG_FILES_DIR}/vcpkg_installed")
8-
set(VCPKG_INSTALL_OPTIONS "--x-abi-tools-use-exact-versions;--downloads-root=${VCPKG_FILES_DIR}/vcpkg_downloads;--x-buildtrees-root=${VCPKG_FILES_DIR}/vcpkg_buildtrees;--x-packages-root=${VCPKG_FILES_DIR}/vcpkg_packages")
9-
set(VCPKG_VERBOSE OFF)
10-
11-
project(BuildAll LANGUAGES CXX)
12-
13-
# ---- Include guards ----
3+
project(component-model LANGUAGES CXX)
144

155
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
16-
message(
17-
FATAL_ERROR
18-
"In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there."
19-
)
6+
message(FATAL_ERROR
7+
"In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there."
8+
)
209
endif()
2110

2211
add_subdirectory(src)
2312
add_subdirectory(test)
13+
14+
enable_testing()

0 commit comments

Comments
 (0)