File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ use std::error::Error;
1717
1818fn main ( ) -> Result < ( ) , Box < dyn Error > > {
1919 let install_dir = cmake:: Config :: new ( "protobuf" )
20+ . define ( "BUILD_SHARED_LIBS" , "ON" )
2021 . define ( "ABSL_PROPAGATE_CXX_STD" , "ON" )
2122 . define ( "protobuf_BUILD_TESTS" , "OFF" )
2223 . define ( "protobuf_DEBUG_POSTFIX" , "" )
Original file line number Diff line number Diff line change 5151
5252use std:: path:: PathBuf ;
5353
54+ /// Installation directory.
55+ const INSTALL_DIR : & str = env ! ( "INSTALL_DIR" ) ;
56+
57+ /// *protoc* binary.
58+ #[ cfg( target_os = "windows" ) ]
59+ const PROTOC_BIN : & str = "protoc.exe" ;
60+ /// *protoc* binary.
61+ #[ cfg( not( target_os = "windows" ) ) ]
62+ const PROTOC_BIN : & str = "protoc" ;
63+
5464/// Returns the path to the vendored protoc binary.
5565pub fn protoc ( ) -> PathBuf {
56- PathBuf :: from ( env ! ( "INSTALL_DIR" ) )
57- . join ( "bin" )
58- . join ( "protoc" )
66+ PathBuf :: from ( INSTALL_DIR ) . join ( "bin" ) . join ( PROTOC_BIN )
5967}
6068
6169/// Returns the path to the vendored include directory.
6270pub fn include ( ) -> PathBuf {
63- PathBuf :: from ( env ! ( " INSTALL_DIR" ) ) . join ( "include" )
71+ PathBuf :: from ( INSTALL_DIR ) . join ( "include" )
6472}
You can’t perform that action at this time.
0 commit comments