`libatomic` is mandatory even when platform does not need it
jpalus opened this issue · 1 comments
Few older platforms require libatomic
for atomic operations but many of them don't (ARMv7 and higher, i686 and higher). mimalloc
however uses it irrespective of target platform when libatomic
is installed making it also part of public interface meaning libraries depending on mimalloc
also need libatomic
:
Lines 229 to 232 in f2712f4
Would be good if:
mimalloc
checked iflibatomic
is really required for target platform (by trying to compile representative atomic operation used within project)- even if required I don't see a reason for
libatomic
being part of public interface so probably better to make it private
Hmm tricky; the current solution seems nice -- if lib atomic is found on the system we use it which prevents link errors on Android for example. On many systems there is no libatomic and there we won't link with it.
From your message, it seems you say there are systems where we do not need libatomic but it is installed on the system?
I am not a cmake expert, how would we make libatomic private?
Thanks