-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Kitware/update-vtk-wasm-sdk
Update to use vtk-wasm-sdk image
- Loading branch information
Showing
12 changed files
with
114 additions
and
86 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
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 |
---|---|---|
@@ -1,63 +1,20 @@ | ||
# base | ||
# Project setup | ||
|
||
## Project setup | ||
## Requirements | ||
|
||
``` | ||
# yarn | ||
yarn | ||
# npm | ||
npm install | ||
# pnpm | ||
pnpm install | ||
``` | ||
|
||
### Build C++ | ||
|
||
``` | ||
npm run build-wasm | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
|
||
``` | ||
# yarn | ||
yarn dev | ||
1. docker | ||
2. npm | ||
|
||
# npm | ||
npm run dev | ||
The build process is composed of two steps. You will need to compile C++ components to generate `.wasm` files and then run some `npm` commands to bundle those into a static site. For convenience, the shell scripts provided for Windows and Unix do everything needed to build a website from a fresh clone. | ||
|
||
# pnpm | ||
pnpm dev | ||
``` | ||
|
||
### Compiles and minifies for production | ||
|
||
``` | ||
# yarn | ||
yarn build | ||
# npm | ||
npm run build | ||
## Build | ||
|
||
# pnpm | ||
pnpm build | ||
**Windows** | ||
```sh | ||
.\build.ps1 | ||
``` | ||
|
||
### Lints and fixes files | ||
|
||
**Unix** | ||
```sh | ||
./build.sh | ||
``` | ||
# yarn | ||
yarn lint | ||
# npm | ||
npm run lint | ||
# pnpm | ||
pnpm lint | ||
``` | ||
|
||
### Customize configuration | ||
|
||
See [Configuration Reference](https://vitejs.dev/config/). |
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,23 @@ | ||
$erroractionpreference = "stop" | ||
|
||
$sdk_version="v9.3.0-2490-g97c85d6930-20240401" | ||
$sdk_image="kitware/vtk-wasm-sdk" | ||
$sdk_config="Release" | ||
|
||
$sdk_dir="/VTK-install/$sdk_config/lib/cmake/vtk" | ||
|
||
docker run ` | ||
--rm ` | ||
-v"$pwd":/vtkWasmBenchmarks ` | ||
${sdk_image}:${sdk_version} ` | ||
emcmake cmake -GNinja -S /vtkWasmBenchmarks -B /vtkWasmBenchmarks/out -DCMAKE_BUILD_TYPE="$sdk_config" -DVTK_DIR="$sdk_dir" | ||
|
||
docker run ` | ||
--rm ` | ||
-v"$pwd":/vtkWasmBenchmarks ` | ||
${sdk_image}:${sdk_version} ` | ||
cmake --build /vtkWasmBenchmarks/out | ||
|
||
npm i | ||
|
||
npm run build |
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,33 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
sdk_version="v9.3.0-2490-g97c85d6930-20240401" | ||
readonly sdk_version | ||
|
||
sdk_image="kitware/vtk-wasm-sdk" | ||
readonly sdk_image | ||
|
||
sdk_config="Release" | ||
readonly sdk_config | ||
|
||
sdk_dir="/VTK-install/$sdk_config/lib/cmake/vtk" | ||
readonly sdk_dir | ||
|
||
docker run \ | ||
--rm \ | ||
-u "$(id -u):$(id -g)" \ | ||
-v"$PWD":/vtkWasmBenchmarks \ | ||
$sdk_image:$sdk_version \ | ||
emcmake cmake -GNinja -S /vtkWasmBenchmarks -B /vtkWasmBenchmarks/out -DCMAKE_BUILD_TYPE=$sdk_config -DVTK_DIR=$sdk_dir | ||
|
||
docker run \ | ||
--rm \ | ||
-v"$PWD":/vtkWasmBenchmarks \ | ||
$sdk_image:$sdk_version \ | ||
cmake --build /vtkWasmBenchmarks/out | ||
|
||
npm i | ||
|
||
npm run build |
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
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
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
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