| 1 |
|
| 2 |
@setlocal EnableExtensions EnableDelayedExpansion |
| 3 |
@echo off |
| 4 |
|
| 5 |
set current-path=%~dp0 |
| 6 |
rem // remove trailing slash |
| 7 |
set current-path=%current-path:~0,-1% |
| 8 |
|
| 9 |
set repo-build-root=%current-path%\..\.. |
| 10 |
rem // resolve to fully qualified path |
| 11 |
for %%i in ("%repo-build-root%") do set repo-build-root=%%~fi |
| 12 |
|
| 13 |
rem ----------------------------------------------------------------------------- |
| 14 |
rem -- build (clean) compilembed tool |
| 15 |
rem ----------------------------------------------------------------------------- |
| 16 |
|
| 17 |
call "%repo-build-root%\tools\compilembed\build.cmd" --clean |
| 18 |
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! |
| 19 |
|
| 20 |
rem ----------------------------------------------------------------------------- |
| 21 |
rem -- build iothub client samples |
| 22 |
rem ----------------------------------------------------------------------------- |
| 23 |
|
| 24 |
call %repo-build-root%\tools\mbed_build_scripts\release_mbed_project.cmd %repo-build-root%\build_all |
| 25 |
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! |
| 26 |
|
| 27 |
goto :eof |
| 28 |
|
| 29 |
:compile |
| 30 |
setlocal EnableExtensions |
| 31 |
set "project_name=%~1" |
| 32 |
set "project_path=%~2" |
| 33 |
set "download_bin_path=%~3" |
| 34 |
set "cmake_project_bin_path=%project_name%_cmake_build" |
| 35 |
|
| 36 |
mkdir %cmake_project_bin_path% |
| 37 |
cd %cmake_project_bin_path% |
| 38 |
cmake -Dmbed_repo_name:string=%project_name% -Dmbed_output_bin_path:string=%download_bin_path% %project_path% |
| 39 |
set CMAKE_ERROR_CODE=!ERRORLEVEL! |
| 40 |
cd .. |
| 41 |
exit /b %CMAKE_ERROR_CODE% |
| 42 |
goto:eof |
| 43 |
|