Skip to content

Commit

Permalink
build(pixi): add mesh-io native configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Aug 16, 2024
1 parent 8e3d5b4 commit 48b4043
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
5 changes: 4 additions & 1 deletion itk_wasm_env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ mkdir -p ${ITK_WASM_ITK_BUILD_DIR} || die "Could not create ITK build directory"


export ITK_WASM_DICOM_TEST_DATA_HASH=${ITK_WASM_DICOM_TEST_DATA_HASH:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_DICOM_TEST_DATA_URLS=${ITK_WASM_DICOM_TEST_DATA_URLS:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}
export ITK_WASM_DICOM_TEST_DATA_URLS=${ITK_WASM_DICOM_TEST_DATA_URLS:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

export ITK_WASM_MESH_IO_TEST_DATA_HASH=${ITK_WASM_MESH_IO_TEST_DATA_HASH:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_MESH_IO_TEST_DATA_URLS=${ITK_WASM_MESH_IO_TEST_DATA_URLS:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}
4 changes: 4 additions & 0 deletions packages/mesh-io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"description": "scripts to generate @itk-wasm/compare-stringify itk-wasm artifacts.",
"type": "module",
"itk-wasm": {
"test-data-hash": "bafkreidvr5jnut7us3umgdm4gqrcqygvpd456z2duaiuiimby7mhvsniii",
"test-data-urls": [
"https://github.com/InsightSoftwareConsortium/ITK-Wasm/releases/download/itk-wasm-v1.0.0-b.155/mesh-io-test-data.tar.gz"
],
"emscripten-docker-image": "itkwasm/emscripten:latest",
"wasi-docker-image": "itkwasm/wasi:latest",
"typescript-package-name": "@itk-wasm/mesh-io",
Expand Down
27 changes: 27 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ depends-on = ["pnpm-install"]
outputs = ["packages/dicom/test/data.tar.gz"]
description = "Download DICOM test data"

[tasks.mesh-io-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_MESH_IO_TEST_DATA_HASH $ITK_WASM_MESH_IO_TEST_DATA_URLS"
cwd = "packages/mesh-io"
depends-on = ["pnpm-install"]
outputs = ["packages/mesh-io/test/data.tar.gz"]
description = "Download mesh-io test data"

[dependencies]
pnpm = ">=9.7.1,<10"
nodejs = ">=22.6.0,<23"
Expand Down Expand Up @@ -133,6 +140,26 @@ cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/dicom-build"
depends-on = ["build-native-dicom"]
description = "Test dicom native binaries"

[feature.native.tasks.configure-native-mesh-io]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/mesh-io-build -Spackages/mesh-io -GNinja
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
-DBUILD_TESTING:BOOL=ON
-DCMAKE_CXX_STANDARD:STRING=20
-DCMAKE_BUILD_TYPE:STRING=Debug'''
depends-on = ["build-itk-wasm", "mesh-io-test-data-download"]
outputs = ["native/mesh-io-build/CMakeFiles/"]
description = "Configure mesh-io native binaries"

[feature.native.tasks.build-native-mesh-io]
cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/mesh-io-build"
depends-on = ["configure-native-mesh-io"]
description = "Build mesh-io native binaries"

[feature.native.tasks.test-native-mesh-io]
cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/mesh-io-build"
depends-on = ["build-native-mesh-io"]
description = "Test mesh-io native binaries"

[feature.native.dependencies]
cmake = ">=3.30.2,<4"
cxx-compiler = ">=1.7.0,<2"
Expand Down

0 comments on commit 48b4043

Please sign in to comment.