11@ REM Copyright (c) Microsoft. All rights reserved.
22@ REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
4- @ setlocal EnableExtensions EnableDelayedExpansion
54@ echo off
65
6+ rem ensure python.exe exists
7+ where /q python.exe
8+ if errorlevel 1 goto :NeedPython
9+
10+ python python_version_check.py > pyenv.bat
11+ if errorlevel 1 goto :NeedPython
12+
13+ call pyenv.bat
14+
15+ @ setlocal EnableExtensions EnableDelayedExpansion
16+
717set build-root = %~dp0
818rem // resolve to fully qualified path
919for %%i in (" %build-root% " ) do set build-root = %%~fi
@@ -13,24 +23,16 @@ rem ----------------------------------------------------------------------------
1323rem -- check prerequisites
1424rem -----------------------------------------------------------------------------
1525
16- rem ensure python.exe exists
17- where /q python.exe
18- if errorlevel 1 goto :NeedPython
19-
2026rem -----------------------------------------------------------------------------
2127rem -- detect Python x86 or x64 version, select build target accordingly
2228rem -----------------------------------------------------------------------------
2329
2430REM target may be set to 64 bit build if a Python x64 detected
25- set build-platform = Win32
2631set build-config = Release
27- set build-python = 2.7
2832set wheel = 0
2933set platname = win32
34+ set use-websockets = OFF
3035
31- python python_version_check.py > pyenv.bat
32- if errorlevel 1 goto :NeedPython
33- call pyenv.bat
3436@ Echo Using Python found in: %PYTHON_PATH% , building Python %build-python% %build-platform% extension
3537goto :args-loop
3638
@@ -43,6 +45,8 @@ exit /b 1
4345if " %1 " equ " " goto args-done
4446if " %1 " equ " --config" goto arg-build-config
4547if " %1 " equ " --wheel" goto arg-build-wheel
48+ if " %1 " equ " --use-websockets" goto arg-use-websockets
49+
4650call :usage && exit /b 1
4751
4852:arg-build-config
@@ -55,6 +59,10 @@ goto args-continue
5559set wheel = 1
5660goto args-continue
5761
62+ :arg-use-websockets
63+ set use-websockets = ON
64+ goto args-continue
65+
5866:args-continue
5967shift
6068goto args-loop
@@ -67,7 +75,13 @@ set cmake-output=cmake_%build-platform%
6775
6876REM -- C --
6977cd %build-root% ..\..\..\c\build_all\windows
70- call build_client.cmd --platform %build-platform% --buildpython %build-python% --config %build-config%
78+
79+ if %use-websockets% == ON (
80+ call build_client.cmd --platform %build-platform% --buildpython %build-python% --config %build-config% --use-websockets --skip-unittests
81+ ) else (
82+ call build_client.cmd --platform %build-platform% --buildpython %build-python% --config %build-config% --skip-unittests
83+ )
84+
7185if not !ERRORLEVEL! == 0 exit /b !ERRORLEVEL!
7286cd %build-root%
7387
@@ -110,3 +124,14 @@ if %wheel%==1 (
110124 dir dist
111125 echo Yet another Python wheel done
112126)
127+ goto :eof
128+
129+ :usage
130+ echo build_client.cmd [options]
131+ echo options:
132+ echo --config ^ < value^ > [Debug] build configuration (e.g. Debug, Release)
133+ echo --platform ^ < value^ > [Win32] build platform (e.g. Win32, x64, ...)
134+ echo --buildpython ^ < value^ > [2.7] build python extension (e.g. 2.7, 3.4, ...)
135+ echo --no-logging Disable logging
136+ echo --use-websockets Enable websocket support for AMQP and MQTT
137+ goto :eof
0 commit comments