@@ -184,12 +184,19 @@ fn build_rocksdb() {
184184 . collect :: < Vec < & ' static str > > ( ) ;
185185
186186 // Add Windows-specific sources
187- lib_sources. push ( "port/win/port_win.cc" ) ;
188- lib_sources. push ( "port/win/env_win.cc" ) ;
189- lib_sources. push ( "port/win/env_default.cc" ) ;
190- lib_sources. push ( "port/win/win_logger.cc" ) ;
191- lib_sources. push ( "port/win/io_win.cc" ) ;
192- lib_sources. push ( "port/win/win_thread.cc" ) ;
187+ lib_sources. extend ( [
188+ "port/win/env_default.cc" ,
189+ "port/win/port_win.cc" ,
190+ "port/win/xpress_win.cc" ,
191+ "port/win/io_win.cc" ,
192+ "port/win/win_thread.cc" ,
193+ "port/win/env_win.cc" ,
194+ "port/win/win_logger.cc" ,
195+ ] ) ;
196+
197+ if cfg ! ( feature = "jemalloc" ) {
198+ lib_sources. push ( "port/win/win_jemalloc.cc" ) ;
199+ }
193200 }
194201
195202 config. define ( "ROCKSDB_SUPPORT_THREAD_LOCAL" , None ) ;
@@ -200,11 +207,19 @@ fn build_rocksdb() {
200207
201208 if target. contains ( "msvc" ) {
202209 config. flag ( "-EHsc" ) ;
210+ config. flag ( "-std:c++17" ) ;
203211 } else {
204212 config. flag ( & cxx_standard ( ) ) ;
205- // this was breaking the build on travis due to
206- // > 4mb of warnings emitted.
213+ // matches the flags in CMakeLists.txt from rocksdb
214+ config. flag ( "-Wsign-compare" ) ;
215+ config. flag ( "-Wshadow" ) ;
207216 config. flag ( "-Wno-unused-parameter" ) ;
217+ config. flag ( "-Wno-unused-variable" ) ;
218+ config. flag ( "-Woverloaded-virtual" ) ;
219+ config. flag ( "-Wnon-virtual-dtor" ) ;
220+ config. flag ( "-Wno-missing-field-initializers" ) ;
221+ config. flag ( "-Wno-strict-aliasing" ) ;
222+ config. flag ( "-Wno-invalid-offsetof" ) ;
208223 }
209224
210225 for file in lib_sources {
@@ -215,6 +230,7 @@ fn build_rocksdb() {
215230 config. file ( "build_version.cc" ) ;
216231
217232 config. cpp ( true ) ;
233+ config. flag_if_supported ( "-std=c++17" ) ;
218234 config. compile ( "librocksdb.a" ) ;
219235}
220236
@@ -287,7 +303,7 @@ fn try_to_find_and_link_lib(lib_name: &str) -> bool {
287303}
288304
289305fn cxx_standard ( ) -> String {
290- env:: var ( "ROCKSDB_CXX_STD" ) . map_or ( "-std=c++11 " . to_owned ( ) , |cxx_std| {
306+ env:: var ( "ROCKSDB_CXX_STD" ) . map_or ( "-std=c++17 " . to_owned ( ) , |cxx_std| {
291307 if !cxx_std. starts_with ( "-std=" ) {
292308 format ! ( "-std={}" , cxx_std)
293309 } else {
0 commit comments