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 ***
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% WITH_RD=%WITH_RD% ROUTING=%ROUTING%
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!"=="mediaclient" (
72 cd %BUILD_DIR%\resource\examples
73 %DEBUG% mediaclient.exe
74 ) else if "!CURRENT_ARG!"=="mediaserver" (
75 cd %BUILD_DIR%\resource\examples
76 %DEBUG% mediaserver.exe
77 ) else if "!CURRENT_ARG!"=="winuiclient" (
78 cd %BUILD_DIR%\resource\examples
79 %DEBUG% winuiclient.exe
80 ) else if "!CURRENT_ARG!"=="occlient" (
81 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
82 %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
83 ) else if "!CURRENT_ARG!"=="ocserver" (
84 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
85 %DEBUG% ocserverbasicops.exe
86 ) else if "!CURRENT_ARG!"=="provclient" (
87 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
88 %DEBUG% provisioningclient.exe
89 ) else if "!CURRENT_ARG!"=="justworks" (
90 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
91 %DEBUG% sampleserver_justworks.exe
92 ) else if "!CURRENT_ARG!"=="test" (
93 %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
94 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
95 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
96 %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
97 %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
98 ) else if "!CURRENT_ARG!"=="build" (
99 echo Starting IoTivity build with these options:
100 echo TARGET_OS=%TARGET_OS%
101 echo TARGET_ARCH=%TARGET_ARCH%
102 echo SECURED=%SECURED%
103 echo LOGGING=%LOGGING%
104 echo WITH_RD=%WITH_RD%
105 echo ROUTING=%ROUTING%
106 CL.exe | findstr "Compiler Verison"
107 echo.scons VERBOSE=1 %BUILD_OPTIONS%
108 scons VERBOSE=1 %BUILD_OPTIONS%
109 ) else if "!CURRENT_ARG!"=="clean" (
110 scons VERBOSE=1 %BUILD_OPTIONS% -c clean
113 ) else if "!CURRENT_ARG!"=="cleangtest" (
114 rd /s /q extlibs\gtest\gtest-1.7.0
115 del extlibs\gtest\gtest-1.7.0.zip
117 echo %0 - Script requires a valid argument!
128 echo %0 - Helper to build/test iotivity. Requires an argument.
129 echo Installation: Drop this into your iotivity root directory to use it.
131 echo. Usage examples:
132 echo Launch SimpleClient with debugger:
135 echo Launch SimpleServer:
138 echo Launch WinUIClient built in msys:
139 echo %0 msys winuiclient