/
build.bat
85 lines (65 loc) · 2.61 KB
/
build.bat
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@rem Copyright 2019 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@REM available windows versions on CI as of 2019-Nov-25
@REM -3.7-64
@REM -3.7-32
@REM -3.6-64
@REM -3.6-32
@REM -3.5-64
@REM -3.5-32
@REM -3.4-64
@REM -3.4-32
@REM -2.7-64
@REM -2.7-32
py -3.7 -m pip install cmake
@rem First, build libcrc32c
set CRC32C_INSTALL_PREFIX=%KOKORO_ARTIFACTS_DIR%\bin_win64\
echo %CRC32C_INSTALL_PREFIX%
pushd google_crc32c
git submodule update --init --recursive
mkdir build
@REM 64 Bit Builds.
@REM removed -DCRC32C_BUILD_TESTS=no
set CMAKE_GENERATOR="Visual Studio 15 2017"
C:\Python37\Scripts\cmake -G %CMAKE_GENERATOR% -A x64 -DCRC32C_BUILD_BENCHMARKS=no -DBUILD_SHARED_LIBS=yes ^
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=yes -DCMAKE_INSTALL_PREFIX:PATH=%CRC32C_INSTALL_PREFIX% .
C:\Python37\Scripts\cmake --build . --config RelWithDebInfo --target install
dir %CRC32C_INSTALL_PREFIX% /b /s
popd
copy %CRC32C_INSTALL_PREFIX%bin\google_crc32c.dll .
@rem update python deps and build wheels (requires CRC32C_INSTALL_PREFIX is set)
FOR %%V IN (3.5-64,3.6-64,3.7-64) DO (
py -%%V -m pip install --upgrade pip setuptools wheel
py -%%V -m pip wheel . --wheel-dir wheels/
)
@REM 32 Bit Builds.
@REM removed -DCRC32C_BUILD_TESTS=no
set CMAKE_GENERATOR="Visual Studio 15 2017"
pushd google_crc32c
@rem reset hard to cleanup any changes done by 64-bit build.
git reset --hard
del /s /q CMakeFiles\
del CMakeCache.txt
set CRC32C_INSTALL_PREFIX=%KOKORO_ARTIFACTS_DIR%\bin_win32\
C:\Python37\Scripts\cmake -G %CMAKE_GENERATOR% -A Win32 -DCRC32C_BUILD_BENCHMARKS=no -DBUILD_SHARED_LIBS=yes ^
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=yes -DCMAKE_INSTALL_PREFIX:PATH=%CRC32C_INSTALL_PREFIX% .
C:\Python37\Scripts\cmake --build . --config RelWithDebInfo --target install
dir %CRC32C_INSTALL_PREFIX% /b /s
popd
copy %CRC32C_INSTALL_PREFIX%bin\google_crc32c.dll .
@rem update python deps and build wheels (requires CRC32C_INSTALL_PREFIX is set)
FOR %%V IN (3.5-32,3.6-32,3.7-32) DO (
py -%%V -m pip install --upgrade pip setuptools wheel
py -%%V -m pip wheel . --wheel-dir wheels/
)