|
6 | 6 | # |
7 | 7 | # ----------------------------------------------------------------------- |
8 | 8 | # Positional parameters: |
9 | | -# - 0th parameter: Python minor version. |
| 9 | +# - 0th parameter or -python_version_minor option: Python minor version. |
10 | 10 | # For instance, for Python 3.11: |
11 | | -# |
12 | 11 | # > windows-download-cache-and-build-module-wheels.ps1 11 |
| 12 | +# or equivalently: |
| 13 | +# > windows-download-cache-and-build-module-wheels.ps1 -python_version_minor 11 |
| 14 | +# |
| 15 | +# - 1st parameter or -setup_options: setup.py options. |
| 16 | +# For instance, for Python 3.11, excluding nvcuda.dll during packaging: |
| 17 | +# > windows-download-cache-and-build-module-wheels.ps1 11 "--exclude-libs nvcuda.dll" |
| 18 | +# or equivalently: |
| 19 | +# > windows-download-cache-and-build-module-wheels.ps1 -python_version_minor 11 -setup_options "--exclude-libs nvcuda.dll" |
13 | 20 | # |
14 | | -# - other parameters are passed to setup.py. If one of the parameters is "--", |
15 | | -# the following parameters will be passed to cmake. |
| 21 | +# - 2nd parameter or -cmake_options: CMake options passed to setup.py for project configuration. |
16 | 22 | # For instance, for Python 3.11, excluding nvcuda.dll during packaging |
17 | 23 | # and setting RTK_USE_CUDA ON during configuration: |
18 | | -# |
19 | | -# > windows-download-cache-and-build-module-wheels.ps1 11 --exclude-libs nvcuda.dll "--" -DRTK_USE_CUDA:BOOL=ON |
| 24 | +# > windows-download-cache-and-build-module-wheels.ps1 11 "--exclude-libs nvcuda.dll" "-DRTK_USE_CUDA:BOOL=ON" |
| 25 | +# or equivalently: |
| 26 | +# > windows-download-cache-and-build-module-wheels.ps1 -python_version_minor 11 -setup_options "--exclude-libs nvcuda.dll" -cmake-options "-DRTK_USE_CUDA:BOOL=ON" |
20 | 27 | # |
21 | 28 | # |
22 | 29 | # ----------------------------------------------------------------------- |
|
37 | 44 | # For instance, `export ITK_MODULE_PREQ=InsightSoftwareConsortium/[email protected]` |
38 | 45 | # |
39 | 46 | ######################################################################## |
| 47 | +param ( |
| 48 | + [int]$python_version_minor, |
| 49 | + [string]$setup_options, |
| 50 | + [string]$cmake_options |
| 51 | +) |
40 | 52 |
|
41 | 53 | $pythonArch = "64" |
42 | | -$pythonVersion = "3.$($args[0])" |
| 54 | +$pythonVersion = "3.$python_version_minor" |
43 | 55 | echo "Pulling Python $pythonVersion-x$pythonArch" |
44 | 56 | iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) |
45 | 57 |
|
@@ -87,15 +99,14 @@ if (-not (Test-Path grep-win.zip)) { |
87 | 99 | $env:Path += ";C:\P\grep" |
88 | 100 |
|
89 | 101 | # Build ITK module dependencies, if any |
90 | | -$build_command = "& `"C:\Python$pythonVersion-x$pythonArch\python.exe`" `"C:\P\IPP\scripts\windows_build_module_wheels.py`" --no-cleanup --py-envs `"3$($args[0])-x64`"" |
91 | | -foreach ($arg in $args[1..$args.length]) { |
92 | | - if ($arg.substring(0,2) -eq "--") { |
93 | | - $build_command = "$build_command $($arg)" |
94 | | - } |
95 | | - else { |
96 | | - $build_command = "$build_command `"$($arg)`"" |
97 | | - } |
| 102 | +$build_command = "& `"C:\Python$pythonVersion-x$pythonArch\python.exe`" `"C:\P\IPP\scripts\windows_build_module_wheels.py`" --no-cleanup --py-envs `"3$python_version_minor-x64`"" |
| 103 | +if ("$setup_options".length -gt 0) { |
| 104 | + $build_command = "$build_command $setup_options" |
| 105 | +} |
| 106 | +if("$cmake_options".length -gt 0) { |
| 107 | + $build_command = "$build_command -- ""$cmake_options""" |
98 | 108 | } |
| 109 | +echo $build_command |
99 | 110 |
|
100 | 111 | echo "ITK_MODULE_PREQ: $env:ITK_MODULE_PREQ $ITK_MODULE_PREQ" |
101 | 112 | if ($env:ITK_MODULE_PREQ) { |
|
0 commit comments