@@ -37,6 +37,17 @@ absl_string_view_dep = dependency(
3737 default_options : [' cpp_std=c++17' ],
3838)
3939
40+ if meson .version().version_compare(' >=1.7.0' )
41+ atomic_dep = dependency (' atomic' )
42+ else
43+ # Try to pick up libatomic. If it isn't available, hope that the host machine doesn't require it for atomics
44+ # support. If it doesn't, protobuf will fail to compile.
45+ atomic_dep = cc.find_library (
46+ ' atomic' ,
47+ required : false ,
48+ )
49+ endif
50+
4051deps = [
4152 dependency (' absl_base' ),
4253 dependency (' absl_cord' ),
@@ -58,6 +69,7 @@ deps = [
5869 ' dbghelp' ,
5970 required : host_machine .system() == ' windows' ,
6071 ),
72+ atomic_dep,
6173]
6274
6375incdir = include_directories (' src' )
@@ -136,6 +148,7 @@ protobuf_lite_dep = declare_dependency(
136148 compile_args : imp,
137149 link_with : libprotobuf_lite,
138150 include_directories : incdir,
151+ dependencies : atomic_dep,
139152)
140153
141154libprotobuf_src = files (
@@ -218,8 +231,8 @@ libprotobuf_src = files(
218231 ' src/google/protobuf/wrappers.pb.cc' ,
219232)
220233libprotobuf_linker_args = (is_msvc ? [
221- ' /export:??$MergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@RepeatedPtrFieldBase@internal@protobuf@google@@QEAAXAEBV0123@@Z' ,
222- ] : []
234+ ' /export:??$MergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@RepeatedPtrFieldBase@internal@protobuf@google@@QEAAXAEBV0123@@Z' ,
235+ ] : []
223236)
224237libprotobuf = library (
225238 ' protobuf' ,
0 commit comments