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 ***
42 set WITH_UPSTREAM_LIBCOAP=1
44 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% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
46 REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
47 REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
48 IF NOT "%MSVC_VERSION%" == "" (
49 set BUILD_OPTIONS=%BUILD_OPTIONS% MSVC_VERSION=%MSVC_VERSION%
52 REM *** BUILD OPTIONS ***
54 if "!CURRENT_ARG!"=="server" (
55 cd %BUILD_DIR%\resource\examples
56 %DEBUG% simpleserver.exe
57 ) else if "!CURRENT_ARG!"=="client" (
58 cd %BUILD_DIR%\resource\examples
59 %DEBUG% simpleclient.exe
60 ) else if "!CURRENT_ARG!"=="serverhq" (
61 cd %BUILD_DIR%\resource\examples
62 %DEBUG% simpleserverHQ.exe
63 ) else if "!CURRENT_ARG!"=="clienthq" (
64 cd %BUILD_DIR%\resource\examples
65 %DEBUG% simpleclientHQ.exe
66 )else if "!CURRENT_ARG!"=="mediaclient" (
67 cd %BUILD_DIR%\resource\examples
68 %DEBUG% mediaclient.exe
69 ) else if "!CURRENT_ARG!"=="mediaserver" (
70 cd %BUILD_DIR%\resource\examples
71 %DEBUG% mediaserver.exe
72 ) else if "!CURRENT_ARG!"=="winuiclient" (
73 cd %BUILD_DIR%\resource\examples
74 %DEBUG% winuiclient.exe
75 ) else if "!CURRENT_ARG!"=="occlient" (
76 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
77 %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
78 ) else if "!CURRENT_ARG!"=="ocserver" (
79 cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
80 %DEBUG% ocserverbasicops.exe
81 ) else if "!CURRENT_ARG!"=="provclient" (
82 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
83 %DEBUG% provisioningclient.exe
84 ) else if "!CURRENT_ARG!"=="justworks" (
85 cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
86 %DEBUG% sampleserver_justworks.exe
87 ) else if "!CURRENT_ARG!"=="test" (
88 %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
89 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
90 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
91 %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
92 %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
93 %DEBUG% %BUILD_DIR%\resource\c_common\ocrandom\test\randomtests.exe
94 %DEBUG% %BUILD_DIR%\resource\c_common\oic_malloc\test\malloctests.exe
95 %DEBUG% %BUILD_DIR%\resource\c_common\oic_string\test\stringtests.exe
96 %DEBUG% %BUILD_DIR%\resource\c_common\oic_time\test\timetests.exe
97 %DEBUG% %BUILD_DIR%\resource\unittests\unittests.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%
104 echo LOGGING=%LOGGING%
105 echo WITH_RD=%WITH_RD%
106 echo ROUTING=%ROUTING%
107 echo WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
108 echo.scons VERBOSE=1 %BUILD_OPTIONS%
109 scons VERBOSE=1 %BUILD_OPTIONS%
110 ) else if "!CURRENT_ARG!"=="clean" (
111 scons VERBOSE=1 %BUILD_OPTIONS% -c clean
114 del extlibs\gtest\gtest*.lib
115 del extlibs\gtest\gtest-1.7.0\src\gtest*.obj
117 erase resource\c_common\iotivity_config.h
118 erase extlibs\libcoap\coap.lib
119 erase extlibs\libcoap\libcoap\include\coap\coap_config.h
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