File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -261,10 +261,17 @@ if (RT_LIBRARY)
261
261
target_link_libraries (bson_shared PRIVATE ${RT_LIBRARY} )
262
262
endif ()
263
263
264
- find_library (M_LIBRARY m )
265
- if (M_LIBRARY )
266
- target_link_libraries (bson_shared PRIVATE ${M_LIBRARY} )
267
- set (BSON_LIBRARIES ${BSON_LIBRARIES} ${M_LIBRARY} )
264
+ # On macOS Big Sur, libm resolves to the SDK's tbd file, like:
265
+ # /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd
266
+ # Not all consumers can easily link to a tbd file (notably golang will reject a tbd suffix by default)
267
+ # macOS includes libm as part of libSystem (along with libc).
268
+ # It does not need to be explicitly linked.
269
+ if (!APPLE )
270
+ find_library (M_LIBRARY m )
271
+ if (M_LIBRARY )
272
+ target_link_libraries (bson_shared PRIVATE ${M_LIBRARY} )
273
+ set (BSON_LIBRARIES ${BSON_LIBRARIES} ${M_LIBRARY} )
274
+ endif ()
268
275
endif ()
269
276
270
277
set (THREADS_PREFER_PTHREAD_FLAG 1 )
You can’t perform that action at this time.
0 commit comments