@@ -37,6 +37,17 @@ absl_string_view_dep = dependency(
37
37
default_options : [' cpp_std=c++17' ],
38
38
)
39
39
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
+
40
51
deps = [
41
52
dependency (' absl_base' ),
42
53
dependency (' absl_cord' ),
@@ -58,6 +69,7 @@ deps = [
58
69
' dbghelp' ,
59
70
required : host_machine .system() == ' windows' ,
60
71
),
72
+ atomic_dep,
61
73
]
62
74
63
75
incdir = include_directories (' src' )
@@ -136,6 +148,7 @@ protobuf_lite_dep = declare_dependency(
136
148
compile_args : imp,
137
149
link_with : libprotobuf_lite,
138
150
include_directories : incdir,
151
+ dependencies : atomic_dep,
139
152
)
140
153
141
154
libprotobuf_src = files (
@@ -218,8 +231,8 @@ libprotobuf_src = files(
218
231
' src/google/protobuf/wrappers.pb.cc' ,
219
232
)
220
233
libprotobuf_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
+ ] : []
223
236
)
224
237
libprotobuf = library (
225
238
' protobuf' ,
0 commit comments