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!;!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 ***
59 REM *** BUILD OPTIONS ***
61 if "!CURRENT_ARG!"=="server" (
62 %DEBUG% %BUILD_DIR%\resource\examples\simpleserver.exe
63 ) else if "!CURRENT_ARG!"=="client" (
64 %DEBUG% %BUILD_DIR%\resource\examples\simpleclient.exe
65 ) else if "!CURRENT_ARG!"=="mediaclient" (
66 %DEBUG% %BUILD_DIR%\debug\resource\examples\mediaclient.exe
67 ) else if "!CURRENT_ARG!"=="mediaserver" (
68 %DEBUG% %BUILD_DIR%\resource\examples\mediaserver.exe
69 ) else if "!CURRENT_ARG!"=="winuiclient" (
70 %DEBUG% %BUILD_DIR%\resource\examples\winuiclient.exe
71 ) else if "!CURRENT_ARG!"=="occlient" (
72 %DEBUG% %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer\occlientbasicops.exe -u 0 -t 3 -c 1
73 ) else if "!CURRENT_ARG!"=="ocserver" (
74 %DEBUG% %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer\ocserverbasicops.exe
75 ) else if "!CURRENT_ARG!"=="test" (
76 %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
77 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
78 %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
79 %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
80 %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
81 ) else if "!CURRENT_ARG!"=="build" (
82 echo Starting IoTivity build with these options:
83 echo TARGET_OS=%TARGET_OS%
84 echo TARGET_ARCH=%TARGET_ARCH%
85 echo SECURED=%SECURED%
86 echo LOGGING=%LOGGING%
87 echo WITH_RD=%WITH_RD%
88 CL.exe | findstr "Compiler Verison"
89 echo.scons VERBOSE=1 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%
90 scons VERBOSE=1 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%
91 ) else if "!CURRENT_ARG!"=="clean" (
92 scons VERBOSE=1 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% -c clean
95 ) else if "!CURRENT_ARG!"=="cleangtest" (
96 rd /s /q extlibs\gtest\gtest-1.7.0
97 del extlibs\gtest\gtest-1.7.0.zip
99 echo %0 - Script requires a valid argument!
108 echo %0 - Helper to build/test iotivity. Requires an argument.
109 echo Installation: Drop this into your iotivity root directory to use it.
111 echo. Usage examples:
112 echo Launch SimpleClient with debugger:
115 echo Launch SimpleServer:
118 echo Launch WinUIClient built in msys:
119 echo %0 msys winuiclient