2 REM Helper script to build and run IoTivity on Windows
3 SETLOCAL ENABLEDELAYEDEXPANSION
21 if "!SECOND_ARG!"=="debug" (
22 set DEBUG="%ProgramFiles(x86)%\Windows Kits\10\Debuggers\x64\cdb.exe" -2 -c "g"
25 IF "%CURRENT_ARG%" == "build" IF "%BUILD_MSYS%" == "" (
26 IF NOT "%VS140COMNTOOLS%" == "" (
27 CALL "%VS140COMNTOOLS%"vsvars32.bat
29 IF NOT "%VS120COMNTOOLS%" == "" (
30 CALL "%VS120COMNTOOLS%"vsvars32.bat
34 IF NOT "!VSINSTALLDIR!" == "" (
35 CALL "!VSINSTALLDIR!VC\vcvarsall.bat" amd64
37 @ECHO WARNING: Could not find vsvarsall.bat.
38 @ECHO WARNING: VISUAL STUDIO 2013/2015 DOES NOT APPEAR TO BE INSTALLED ON THIS MACHINE
43 REM We need to append the "PATH" so the octbstack.dll can be found by executables
44 IF "%BUILD_MSYS%" == "" (
45 set BUILD_DIR=out\windows\amd64\debug
46 set PATH=!PATH!;!IOTIVITY_DIR!!BUILD_DIR!;
48 set BUILD_DIR=out\msys_nt\x86_64\debug
49 set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
52 REM *** BUILD OPTIONS ***
60 set WITH_UPSTREAM_LIBCOAP=0
61 set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% RELEASE=0 WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=0 BUILD_SAMPLE=ON LOGGING=%LOGGING% TEST=%TEST% RD_MODE=CLIENT ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
63 REM *** BUILD OPTIONS ***
65 if "!CURRENT_ARG!"=="server" (
66 cd %BUILD_DIR%\resource\examples
67 %DEBUG% simpleserver.exe
68 ) else if "!CURRENT_ARG!"=="client" (
69 cd %BUILD_DIR%\resource\examples
70 %DEBUG% simpleclient.exe
71 ) else if "!CURRENT_ARG!"=="serverhq" (
72 cd %BUILD_DIR%\resource\examples
73 %DEBUG% simpleserverHQ.exe
74 ) else if "!CURRENT_ARG!"=="clienthq" (
75 cd %BUILD_DIR%\resource\examples
76 %DEBUG% simpleclientHQ.exe
77 )else if "!CURRENT_ARG!"=="mediaclient" (
78 cd %BUILD_DIR%\resource\examples
79 %DEBUG% mediaclient.exe
80 ) else if "!CURRENT_ARG!"=="mediaserver" (
81 cd %BUILD_DIR%\resource\examples
82 %DEBUG% mediaserver.exe
83 ) else if "!CURRENT_ARG!"=="winuiclient" (
84 cd %BUILD_DIR%\resource\examples
85 %DEBUG% winuiclient.exe
86 ) else if "!CURRENT_ARG!"=="occlient" (
87 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
88 %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
89 ) else if "!CURRENT_ARG!"=="ocserver" (
90 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
91 %DEBUG% ocserverbasicops.exe
92 ) else if "!CURRENT_ARG!"=="provclient" (
93 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
94 %DEBUG% provisioningclient.exe
95 ) else if "!CURRENT_ARG!"=="justworks" (
96 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
97 %DEBUG% sampleserver_justworks.exe
98 ) else if "!CURRENT_ARG!"=="test" (
99 %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
100 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
101 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
102 %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
103 %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
104 ) else if "!CURRENT_ARG!"=="build" (
105 echo Starting IoTivity build with these options:
106 echo TARGET_OS=%TARGET_OS%
107 echo TARGET_ARCH=%TARGET_ARCH%
108 echo SECURED=%SECURED%
110 echo LOGGING=%LOGGING%
111 echo ROUTING=%ROUTING%
112 echo WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
113 CL.exe | findstr "Compiler Verison"
114 echo.scons VERBOSE=1 %BUILD_OPTIONS%
115 scons VERBOSE=1 %BUILD_OPTIONS%
116 ) else if "!CURRENT_ARG!"=="clean" (
117 scons VERBOSE=1 %BUILD_OPTIONS% -c clean
120 ) else if "!CURRENT_ARG!"=="cleangtest" (
121 rd /s /q extlibs\gtest\gtest-1.7.0
122 del extlibs\gtest\gtest-1.7.0.zip
124 echo %0 - Script requires a valid argument!
135 echo %0 - Helper to build/test iotivity. Requires an argument.
136 echo Installation: Drop this into your iotivity root directory to use it.
138 echo. Usage examples:
139 echo Launch SimpleClient with debugger:
142 echo Launch SimpleServer:
145 echo Launch WinUIClient built in msys:
146 echo %0 msys winuiclient