@@ -36,21 +36,65 @@ ITK-Wasm's [C++ core](../introduction/parts.md#cxx-core) can be developed with n
36
36
2 . Build the ` WebAssemblyInterface ` module from this module against ITK
37
37
3 . Run the tests
38
38
39
+ We recommend using the scripts provided in [ dev-utils] ( ../../dev-utils/ ) folder
40
+ to [ grab the source code] ( ../../dev-utils/itk-wasm-native-get-source.sh ) and run [ native build commands] ( ../../dev-utils/itk-wasm-native-build.sh ) .
41
+ Note that you will need to include certain CXX compiler flags for the native windows build as shown in the script.
42
+ The build script also demonstrates how to native build sub-packages such as @itk-wasm/dicom with additional ITK dependencies turned on.
43
+
39
44
From a command line, these steps in brief are:
40
45
41
46
``` sh
47
+ # For Windows build (with mingw-bash or git-bash terminal)
48
+ export CXXFLAGS=" /Zc:__cplusplus /DNOMINMAX"
49
+
42
50
# Build ITK
43
- git clone https://github.com/InsightSoftwareConsortium/ITK
44
- cmake -BITK-build -SITK -DBUILD_TESTING=OFF -DModule_MeshToPolyData=ON
45
- cmake --build ITK-build
51
+ git clone https://github.com/InsightSoftwareConsortium/ITK --branch=itkwasm-main-mutable
52
+ # cmake -BITK-build -SITK -DBUILD_TESTING=OFF -DModule_MeshToPolyData=ON -DITK_MSVC_STATIC_RUNTIME_LIBRARY=ON
53
+ cmake -BITK-build -SITK \
54
+ -DBUILD_TESTING=OFF \
55
+ -DCMAKE_CXX_STANDARD:STRING=17 \
56
+ -DCMAKE_BUILD_TYPE:STRING=Debug \
57
+ -DCMAKE_CONFIGURATION_TYPES:STRING=Debug \
58
+ -DBUILD_EXAMPLES:BOOL=OFF \
59
+ -DBUILD_TESTING:BOOL=OFF \
60
+ -DBUILD_SHARED_LIBS=OFF \
61
+ -DBUILD_STATIC_LIBS=ON \
62
+ -DDCMTK_LINK_STATIC=ON \
63
+ -DITK_LEGACY_REMOVE:BOOL=ON \
64
+ -DITK_BUILD_DEFAULT_MODULES:BOOL=ON \
65
+ -DModule_MeshToPolyData=ON \
66
+ -DDO_NOT_BUILD_ITK_TEST_DRIVER:BOOL=ON \
67
+ -DOPJ_USE_THREAD:BOOL=OFF \
68
+ -DDCMTK_WITH_THREADS:BOOL=OFF \
69
+ -DDCMTK_BUILD_APPS:BOOL=OFF \
70
+ -DNO_FLOAT_EXCEPTIONS:BOOL=ON \
71
+ -DITK_MSVC_STATIC_RUNTIME_LIBRARY=ON
72
+ cmake --build ITK-build --config Debug -j16
46
73
47
74
# Build the WebAssemblyInterface module from this module against ITK
48
75
git clone https://github.com/InsightSoftwareConsortium/ITK-Wasm
49
- cmake -Bitk-wasm-build -Sitk-wasm -DBUILD_TESTING=ON -DITK_DIR=$PWD /ITK-build
50
- cmake --build itk-wasm-build
76
+ cmake -BITK-Wasm-build \
77
+ -SITK-Wasm \
78
+ -DBUILD_TESTING=ON \
79
+ -DCMAKE_CXX_STANDARD:STRING=20 \
80
+ -DCMAKE_BUILD_TYPE:STRING=Debug \
81
+ -DCMAKE_CONFIGURATION_TYPES:STRING=Debug \
82
+ -DBUILD_SHARED_LIBS=OFF \
83
+ -DITK_DIR=$PWD /ITK-build
84
+ cmake --build ITK-Wasm-build --config Debug -j16
51
85
52
86
# Run the tests
53
87
ctest --test-dir itk-wasm-build
88
+
89
+ cmake -Bpackages-dicom \
90
+ -SITK-Wasm/packages/dicom \
91
+ -DBUILD_TESTING=ON \
92
+ -DCMAKE_CXX_STANDARD:STRING=20 \
93
+ -DCMAKE_BUILD_TYPE:STRING=Debug \
94
+ -DCMAKE_CONFIGURATION_TYPES:STRING=Debug \
95
+ -DITK_DIR=$PWD /ITK-build
96
+
97
+ cmake --build packages-dicom --config Debug -j16
54
98
```
55
99
56
100
For additional guidance on C++ development, see the [ ITK Software Guide] .
0 commit comments