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 REM We need to append the "PATH" so the octbstack.dll can be found by executables
26 IF "%BUILD_MSYS%" == "" (
27 set BUILD_DIR=out\windows\amd64\debug
28 set PATH=!PATH!;!IOTIVITY_DIR!!BUILD_DIR!;
30 set BUILD_DIR=out\msys_nt\x86_64\debug
31 set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
34 REM *** BUILD OPTIONS ***
43 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%
45 REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
46 REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
47 IF NOT "%MSVC_VERSION%" == "" (
48 set BUILD_OPTIONS=%BUILD_OPTIONS% MSVC_VERSION=%MSVC_VERSION%
51 REM *** BUILD OPTIONS ***
53 if "!CURRENT_ARG!"=="server" (
54 cd %BUILD_DIR%\resource\examples
55 %DEBUG% simpleserver.exe
56 ) else if "!CURRENT_ARG!"=="client" (
57 cd %BUILD_DIR%\resource\examples
58 %DEBUG% simpleclient.exe
59 ) else if "!CURRENT_ARG!"=="serverhq" (
60 cd %BUILD_DIR%\resource\examples
61 %DEBUG% simpleserverHQ.exe
62 ) else if "!CURRENT_ARG!"=="clienthq" (
63 cd %BUILD_DIR%\resource\examples
64 %DEBUG% simpleclientHQ.exe
65 )else if "!CURRENT_ARG!"=="mediaclient" (
66 cd %BUILD_DIR%\resource\examples
67 %DEBUG% mediaclient.exe
68 ) else if "!CURRENT_ARG!"=="mediaserver" (
69 cd %BUILD_DIR%\resource\examples
70 %DEBUG% mediaserver.exe
71 ) else if "!CURRENT_ARG!"=="winuiclient" (
72 cd %BUILD_DIR%\resource\examples
73 %DEBUG% winuiclient.exe
74 ) else if "!CURRENT_ARG!"=="occlient" (
75 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
76 %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
77 ) else if "!CURRENT_ARG!"=="ocserver" (
78 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
79 %DEBUG% ocserverbasicops.exe
80 ) else if "!CURRENT_ARG!"=="provclient" (
81 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
82 %DEBUG% provisioningclient.exe
83 ) else if "!CURRENT_ARG!"=="justworks" (
84 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
85 %DEBUG% sampleserver_justworks.exe
86 ) else if "!CURRENT_ARG!"=="test" (
87 %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
88 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
89 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
90 %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
91 %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
92 ) else if "!CURRENT_ARG!"=="build" (
93 echo Starting IoTivity build with these options:
94 echo TARGET_OS=%TARGET_OS%
95 echo TARGET_ARCH=%TARGET_ARCH%
96 echo SECURED=%SECURED%
97 echo LOGGING=%LOGGING%
98 echo WITH_RD=%WITH_RD%
99 echo ROUTING=%ROUTING%
100 echo.scons VERBOSE=1 %BUILD_OPTIONS%
101 scons VERBOSE=1 %BUILD_OPTIONS%
102 ) else if "!CURRENT_ARG!"=="clean" (
103 scons VERBOSE=1 %BUILD_OPTIONS% -c clean
106 del extlibs\gtest\gtest*.lib
107 del extlibs\gtest\gtest-1.7.0\src\gtest*.obj
108 ) else if "!CURRENT_ARG!"=="cleangtest" (
109 rd /s /q extlibs\gtest\gtest-1.7.0
110 del extlibs\gtest\gtest-1.7.0.zip
112 echo %0 - Script requires a valid argument!
123 echo %0 - Helper to build/test iotivity. Requires an argument.
124 echo Installation: Drop this into your iotivity root directory to use it.
126 echo. Usage examples:
127 echo Launch SimpleClient with debugger:
130 echo Launch SimpleServer:
133 echo Launch WinUIClient built in msys:
134 echo %0 msys winuiclient