Skip to content

Commit

Permalink
Build in root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ejona86 committed Jun 24, 2022
1 parent c2d8e15 commit 9f91846
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions buildscripts/kokoro/windows32.bat
Expand Up @@ -26,8 +26,8 @@ cd "%WORKSPACE%"

SET TARGET_ARCH=x86_32
SET FAIL_ON_WARNINGS=true
SET VC_PROTOBUF_LIBS=%ESCWORKSPACE%\\grpc-java-helper32\\protobuf-%PROTOBUF_VER%\\cmake\\build\\Release
SET VC_PROTOBUF_INCLUDE=%ESCWORKSPACE%\\grpc-java-helper32\\protobuf-%PROTOBUF_VER%\\cmake\\build\\include
SET VC_PROTOBUF_LIBS=%ESCWORKSPACE%\\grpc-java-helper32\\protobuf-%PROTOBUF_VER%\\Release
SET VC_PROTOBUF_INCLUDE=%ESCWORKSPACE%\\grpc-java-helper32\\protobuf-%PROTOBUF_VER%\\include
SET GRADLE_FLAGS=-PtargetArch=%TARGET_ARCH% -PfailOnWarnings=%FAIL_ON_WARNINGS% -PvcProtobufLibs=%VC_PROTOBUF_LIBS% -PvcProtobufInclude=%VC_PROTOBUF_INCLUDE% -PskipAndroid=true

cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% build"
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/kokoro/windows64.bat
Expand Up @@ -25,8 +25,8 @@ cd "%WORKSPACE%"

SET TARGET_ARCH=x86_64
SET FAIL_ON_WARNINGS=true
SET VC_PROTOBUF_LIBS=%ESCWORKSPACE%\\grpc-java-helper64\\protobuf-%PROTOBUF_VER%\\cmake\\build\\Release
SET VC_PROTOBUF_INCLUDE=%ESCWORKSPACE%\\grpc-java-helper64\\protobuf-%PROTOBUF_VER%\\cmake\\build\\include
SET VC_PROTOBUF_LIBS=%ESCWORKSPACE%\\grpc-java-helper64\\protobuf-%PROTOBUF_VER%\\Release
SET VC_PROTOBUF_INCLUDE=%ESCWORKSPACE%\\grpc-java-helper64\\protobuf-%PROTOBUF_VER%\\include
SET GRADLE_FLAGS=-PtargetArch=%TARGET_ARCH% -PfailOnWarnings=%FAIL_ON_WARNINGS% -PvcProtobufLibs=%VC_PROTOBUF_LIBS% -PvcProtobufInclude=%VC_PROTOBUF_INCLUDE% -PskipAndroid=true

@rem make sure no daemons have any files open
Expand Down
9 changes: 4 additions & 5 deletions buildscripts/make_dependencies.bat
Expand Up @@ -3,12 +3,12 @@ set PROTOBUF_VER=21.1
set PROTOBUF_VER_ISSUE_10172=3.%PROTOBUF_VER%
set CMAKE_NAME=cmake-3.23.2-windows-x86_64

if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (
if not exist "protobuf-%PROTOBUF_VER%\Release\" (
call :installProto || exit /b 1
)

echo Compile gRPC-Java with something like:
echo -PtargetArch=x86_32 -PvcProtobufLibs=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\Release -PvcProtobufInclude=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\include
echo -PtargetArch=x86_32 -PvcProtobufLibs=%cd%\protobuf-%PROTOBUF_VER%\Release -PvcProtobufInclude=%cd%\protobuf-%PROTOBUF_VER%\include
goto :eof


Expand All @@ -26,8 +26,7 @@ powershell -command "$ErrorActionPreference = 'stop'; & { [Net.ServicePointManag
powershell -command "$ErrorActionPreference = 'stop'; & { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }" || exit /b 1
del protobuf.zip
rename protobuf-%PROTOBUF_VER_ISSUE_10172% protobuf-%PROTOBUF_VER%
mkdir protobuf-%PROTOBUF_VER%\build
pushd protobuf-%PROTOBUF_VER%\build
pushd protobuf-%PROTOBUF_VER%

@rem cmake does not detect x86_64 from the vcvars64.bat variables.
@rem If vcvars64.bat has set PLATFORM to X64, then inform cmake to use the Win64 version of VS
Expand All @@ -37,7 +36,7 @@ if "%PLATFORM%" == "X64" (
) else (
SET CMAKE_VSARCH=
)
cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%%CMAKE_VSARCH%" .. || exit /b 1
cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%%CMAKE_VSARCH%" . || exit /b 1
msbuild /maxcpucount /p:Configuration=Release /verbosity:minimal libprotoc.vcxproj || exit /b 1
call extract_includes.bat || exit /b 1
popd
Expand Down

0 comments on commit 9f91846

Please sign in to comment.