2
0

build-benchmark.cmd 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. REM Copyright The OpenTelemetry Authors
  2. REM SPDX-License-Identifier: Apache-2.0
  3. @echo off
  4. set BUILDTOOLS_VERSION=vs2019
  5. set CMAKE_GEN="Visual Studio 16 2019"
  6. echo Building Google Benchmark (test only dependency)...
  7. @setlocal ENABLEEXTENSIONS
  8. echo Auto-detecting Visual Studio version...
  9. call "%~dp0\vcvars.cmd"
  10. pushd "%~dp0\.."
  11. set "ROOT=%CD%"
  12. set MAXCPUCOUNT=%NUMBER_OF_PROCESSORS%
  13. set platform=
  14. if not exist "%ROOT%\third_party\benchmark\" (
  15. echo "Google Benchmark library is not available, skipping benchmark build."
  16. call skip_the_build
  17. )
  18. cd "%ROOT%\third_party\benchmark\"
  19. set "GOOGLETEST_PATH=%ROOT%\third_party\googletest"
  20. if not exist "build" (
  21. mkdir build
  22. )
  23. cd build
  24. REM By default we generate the project for the older Visual Studio 2017 even if we have newer version installed
  25. cmake ../ -G %CMAKE_GEN% -Ax64 -DBENCHMARK_ENABLE_TESTING=OFF
  26. set SOLUTION=%ROOT%\third_party\benchmark\build\benchmark.sln
  27. msbuild %SOLUTION% /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=x64
  28. msbuild %SOLUTION% /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=x64
  29. popd
  30. :skip_the_build