From 48b40439cc4a40d7909988c855fdaf12bddcf058 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 16 Aug 2024 15:37:31 -0400 Subject: [PATCH] build(pixi): add mesh-io native configuration --- itk_wasm_env.bash | 5 ++++- packages/mesh-io/package.json | 4 ++++ pixi.toml | 27 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/itk_wasm_env.bash b/itk_wasm_env.bash index 93feffd46..1a19b9ad1 100755 --- a/itk_wasm_env.bash +++ b/itk_wasm_env.bash @@ -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(" ")')} \ No newline at end of file +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(" ")')} \ No newline at end of file diff --git a/packages/mesh-io/package.json b/packages/mesh-io/package.json index 943ec979f..2387f6636 100644 --- a/packages/mesh-io/package.json +++ b/packages/mesh-io/package.json @@ -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", diff --git a/pixi.toml b/pixi.toml index 4144fc605..d9fe045c1 100644 --- a/pixi.toml +++ b/pixi.toml @@ -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" @@ -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"