Skip to content

Commit

Permalink
Support Visual Studio 2017 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
damonbarry committed Mar 24, 2017
1 parent a213531 commit c1687a8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deps/c-utility
2 changes: 1 addition & 1 deletion deps/umqtt
Submodule umqtt updated 1 files
+1 −1 c-utility
26 changes: 17 additions & 9 deletions tools/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,21 @@ rem ----------------------------------------------------------------------------
rem this is setting the cmake path in a quoted way
set "cmake-root=%build-root%\build"

rem Figure out which CMake generator to use
if "%VisualStudioVersion%" == "14.0" (
set "cmake-generator=Visual Studio 14 2015"
) else if "%VisualStudioVersion%" == "15.0" (
set "cmake-generator=Visual Studio 15 2017"
)
if NOT DEFINED cmake-generator (
echo ERROR: VisualStudioVersion not defined, or not one of ^(14.0, 15.0^)
exit /b 1
)
if "%build-platform%" == "x64" (
set "cmake-generator=%cmake-generator% Win64"
)
echo **Building for "%cmake-generator%"

echo Cleaning up build artifacts...
rmdir /s/q %cmake-root%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
Expand All @@ -168,15 +183,8 @@ mkdir %cmake-root%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!

pushd %cmake-root%
if %build-platform% == x64 (
echo ***Running CMAKE for Win64***
cmake %dependency_install_prefix% -DCMAKE_BUILD_TYPE="%build-config%" -Drun_unittests:BOOL=%CMAKE_run_unittests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Denable_dotnet_binding:BOOL=%CMAKE_enable_dotnet_binding% -Denable_dotnet_core_binding:BOOL=%CMAKE_enable_dotnet_core_binding% -Denable_java_binding:BOOL=%enable-java-binding% -Denable_nodejs_binding:BOOL=%enable_nodejs_binding% -Denable_native_remote_modules:BOOL=%enable_native_remote_modules% -Denable_java_remote_modules:BOOL=%enable_java_remote_modules% -Denable_ble_module:BOOL=%CMAKE_enable_ble_module% -Drebuild_deps:BOOL=%rebuild_deps% -Duse_xplat_uuid:BOOL=%use_xplat_uuid% -G "Visual Studio 14 Win64" "%build-root%"
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
) else (
echo ***Running CMAKE for Win32***
cmake %dependency_install_prefix% -DCMAKE_BUILD_TYPE="%build-config%" -Drun_unittests:BOOL=%CMAKE_run_unittests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Denable_dotnet_binding:BOOL=%CMAKE_enable_dotnet_binding% -Denable_dotnet_core_binding:BOOL=%CMAKE_enable_dotnet_core_binding% -Denable_java_binding:BOOL=%enable-java-binding% -Denable_nodejs_binding:BOOL=%enable_nodejs_binding% -Denable_native_remote_modules:BOOL=%enable_native_remote_modules% -Denable_java_remote_modules:BOOL=%enable_java_remote_modules% -Denable_ble_module:BOOL=%CMAKE_enable_ble_module% -Drebuild_deps:BOOL=%rebuild_deps% -Duse_xplat_uuid:BOOL=%use_xplat_uuid% -G "Visual Studio 14" "%build-root%"
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
)
cmake %dependency_install_prefix% -DCMAKE_BUILD_TYPE="%build-config%" -Drun_unittests:BOOL=%CMAKE_run_unittests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Denable_dotnet_binding:BOOL=%CMAKE_enable_dotnet_binding% -Denable_dotnet_core_binding:BOOL=%CMAKE_enable_dotnet_core_binding% -Denable_java_binding:BOOL=%enable-java-binding% -Denable_nodejs_binding:BOOL=%enable_nodejs_binding% -Denable_native_remote_modules:BOOL=%enable_native_remote_modules% -Denable_java_remote_modules:BOOL=%enable_java_remote_modules% -Denable_ble_module:BOOL=%CMAKE_enable_ble_module% -Drebuild_deps:BOOL=%rebuild_deps% -Duse_xplat_uuid:BOOL=%use_xplat_uuid% -G "%cmake-generator%" "%build-root%"
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!

msbuild /m /p:Configuration="%build-config%" /p:Platform="%build-platform%" azure_iot_gateway_sdk.sln
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
Expand Down

0 comments on commit c1687a8

Please sign in to comment.