Force plugin to link statically on Windows

This commit is contained in:
murgatroid99 2019-02-13 15:22:48 -08:00
parent 8bb3f0a130
commit 90233c965f
2 changed files with 11 additions and 2 deletions

View File

@ -18,6 +18,9 @@ add_executable(grpc_node_plugin
src/node_plugin.cc
)
if (MSVC)
add_definitions(/MT)
endif (MSVC)
target_include_directories(grpc_node_plugin
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -33,8 +33,14 @@ foreach ($Arch in $ArchList) {
$Generator = "Visual Studio 14 2015"
}
& cmake.exe .
& cmake.exe --build .
& cmake.exe . --config Release
if ($LASTEXITCODE -ne 0) {
throw "cmake failed"
}
& cmake.exe --build . --config Release
if ($LASTEXITCODE -ne 0) {
throw "cmake build failed"
}
Copy-Item ($ProtobufBase + "/protoc.exe") -Destination ($Base + "/build/bin/protoc.exe")
Copy-Item ($Base + "/grpc_node_plugin.exe") -Destination ($Base + "/build/bin/grpc_node_plugin.exe")