-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall_build_win.sh
More file actions
executable file
·56 lines (45 loc) · 940 Bytes
/
all_build_win.sh
File metadata and controls
executable file
·56 lines (45 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash
VCPKG_PATH="${1}"
REMOVE="${2}"
# python version
function ensure_env
{
if ! conda env list | grep "^__${1} "
then
conda create -y -n "__${1}" python=${1}
fi
}
# python version
function remove_env
{
if conda env list | grep "^__${1} "
then
conda env remove -y -n "__${1}"
fi
}
# python version
function build_version
{
rm -rf build_all
mkdir build_all
cd build_all
conda activate "__${1}"
cmake -DCMAKE_TOOLCHAIN_FILE="${VCPKG_PATH}" -DPYBIND11_PYTHON_VERSION=${1} ../
cmake --build . --config Release
mkdir -p ../build_binaries
mv Release/*.pyd ../build_binaries
conda deactivate
cd ..
rm -rf build_all
}
PY_VERSIONS="3.6 3.7 3.8 3.9 3.10"
for VER in $PY_VERSIONS
do
echo "Building version: ${VER}"
ensure_env ${VER}
build_version ${VER}
if [ "${REMOVE}" = "YES" ]
then
remove_env ${VER}
fi
done