@@ -53,12 +53,15 @@ comm_env.Replace(
5353 LIBPATH = []
5454 )
5555
56- comm_env .Replace (CXXFLAGS = comm_env ['CXXFLAGS' ].replace ("-Weffc++" , "" ))
57- comm_env .Replace (CXXFLAGS = re .sub ("-Warray-bounds[^\s]+" , "-Warray-bounds=1" , comm_env ['CXXFLAGS' ]))
58- comm_env .Replace (CXXFLAGS = re .sub ("-Wsuggest-attribute=const" , "-Wno-suggest-attribute=const" , comm_env ['CXXFLAGS' ]))
59- comm_env .Replace (CXXFLAGS = re .sub ("-Wsuggest-final-types" , "-Wno-suggest-final-types" , comm_env ['CXXFLAGS' ]))
60- comm_env .Replace (CXXFLAGS = re .sub ("-Wuseless-cast" , "-Wno-useless-cast" , comm_env ['CXXFLAGS' ]))
61- comm_env .Replace (CXXFLAGS = re .sub ("-Wsuggest-override" , "-Wno-suggest-override" , comm_env ['CXXFLAGS' ]))
56+ # This is to compile protobuf-based .cc whose code-generation we do not control.
57+ # The rest of the code is supposed to compiled using higher standards.
58+ lenient_env = comm_env .Clone ()
59+ lenient_env .Replace (CXXFLAGS = lenient_env ['CXXFLAGS' ].replace ("-Weffc++" , "" ))
60+ lenient_env .Replace (CXXFLAGS = re .sub ("-Warray-bounds[^\s]+" , "-Warray-bounds=1" , lenient_env ['CXXFLAGS' ]))
61+ lenient_env .Replace (CXXFLAGS = re .sub ("-Wsuggest-attribute=const" , "-Wno-suggest-attribute=const" , lenient_env ['CXXFLAGS' ]))
62+ lenient_env .Replace (CXXFLAGS = re .sub ("-Wsuggest-final-types" , "-Wno-suggest-final-types" , lenient_env ['CXXFLAGS' ]))
63+ lenient_env .Replace (CXXFLAGS = re .sub ("-Wuseless-cast" , "-Wno-useless-cast" , lenient_env ['CXXFLAGS' ]))
64+ lenient_env .Replace (CXXFLAGS = re .sub ("-Wsuggest-override" , "-Wno-suggest-override" , lenient_env ['CXXFLAGS' ]))
6265
6366comm_cc = [
6467 'src/comm/ConnClient.cc' ,
@@ -86,15 +89,19 @@ client_env.Replace(
8689
8790compileProtoFiles (client_env )
8891
89- client_cc = [
92+ protobuf_cc = [
9093 'src/aperturedb/queryMessage.pb.cc' ,
94+ ]
95+ client_cc = [
9196 'src/aperturedb/TokenBasedVDMSClient.cc' ,
9297 'src/aperturedb/VDMSClient.cc' ,
9398 'src/aperturedb/VDMSClientImpl.cc'
9499 ]
95100
96101client_env .ParseConfig ('pkg-config --cflags --libs protobuf' )
97- ulib = client_env .SharedLibrary ('lib/aperturedb-client' , client_cc )
102+ ulib = client_env .SharedLibrary ('lib/aperturedb-client' ,
103+ [client_cc , lenient_env .SharedObject (protobuf_cc )]
104+ )
98105
99106CXXFLAGS = env ['CXXFLAGS' ]
100107
0 commit comments