@@ -3,7 +3,7 @@ use std::fs;
3
3
use std:: path:: { Path , PathBuf } ;
4
4
use std:: process:: Command ;
5
5
6
- use anyhow:: { ensure , Context , Result } ;
6
+ use anyhow:: { Context , Result } ;
7
7
8
8
fn main ( ) -> Result < ( ) > {
9
9
let out_dir =
@@ -20,8 +20,6 @@ fn main() -> Result<()> {
20
20
let protobuf_dir = & out_dir. join ( format ! ( "protobuf-{}" , version) ) ;
21
21
22
22
if !protobuf_dir. exists ( ) {
23
- apply_patches ( & src_dir) ?;
24
-
25
23
let build_dir = & out_dir. join ( format ! ( "build-protobuf-{}" , version) ) ;
26
24
fs:: create_dir_all ( build_dir) . expect ( "failed to create build directory" ) ;
27
25
@@ -90,25 +88,6 @@ fn git_describe(src_dir: &Path) -> Result<String> {
90
88
Ok ( stdout. trim ( ) . to_string ( ) )
91
89
}
92
90
93
- /// Apply patches to the protobuf source directory
94
- fn apply_patches ( src_dir : & Path ) -> Result < ( ) > {
95
- let mut patch_src = env:: current_dir ( ) . context ( "failed to get current working directory" ) ?;
96
- patch_src. push ( "src" ) ;
97
- patch_src. push ( "fix-conformance_test_runner-cmake-build.patch" ) ;
98
-
99
- let rc = Command :: new ( "patch" )
100
- . arg ( "-p1" )
101
- . arg ( "-i" )
102
- . arg ( patch_src)
103
- . current_dir ( src_dir)
104
- . status ( )
105
- . context ( "failed to apply patch" ) ?;
106
- // exit code: 0 means success; 1 means already applied
107
- ensure ! ( rc. code( ) . unwrap( ) <= 1 , "protobuf patch failed" ) ;
108
-
109
- Ok ( ( ) )
110
- }
111
-
112
91
fn install_protoc_and_conformance_test_runner (
113
92
src_dir : & Path ,
114
93
build_dir : & Path ,
@@ -119,7 +98,9 @@ fn install_protoc_and_conformance_test_runner(
119
98
let build_conformance = !cfg ! ( windows) ;
120
99
121
100
// Build and install protoc, the protobuf libraries, and the conformance test runner.
122
- cmake:: Config :: new ( src_dir. join ( "cmake" ) )
101
+ cmake:: Config :: new ( src_dir)
102
+ . define ( "CMAKE_CXX_STANDARD" , "14" )
103
+ . define ( "ABSL_PROPAGATE_CXX_STD" , "ON" )
123
104
. define ( "CMAKE_INSTALL_PREFIX" , prefix_dir)
124
105
. define (
125
106
"protobuf_BUILD_CONFORMANCE" ,
0 commit comments