Closed mahtin closed 2 years ago
Hi,
Thanks for the bug report!
I think the correct way is to explicitly check if version scripts are supported (instead of checking which platform it is, with the implicit understanding that some platforms don't support version scripts). I've seen some other projects do that. The question I don't know the answer to is what to do if version scripts aren't supported. It seems wrong to just export all symbols.
I agree; however, I don't know how to check that ld
option from within cmake
.
In the meantime, it would be nice to have a working build on Mac's straight from your GitHub release sooner vs later. Symbols aside, I can confirm the code works on a Mac.
Sadly, if you wanted to go down a rabbit-hole, there's also the need to build on BSD in-general. The CMAKE_SYSTEM_NAME
option could be used to match FreeBSD
; but, that may not be enough. As i said, rabbit-hole.
I've been pointed to a solution by @job (much appreciated) which removes APPLE
and correctly tests for the appropriate ld
options via check_linker_flag()
. I honestly can't say it's pretty; however, it's well worth a read.
https://reviews.llvm.org/D84559?id=280595
@ryeng - Your call if you want to go this route. I'm happy to test.
When building on a Mac ...
Hence the following was needed to build the library on a Mac.
However, I don't know if that's the correct way to solve this build issue. I'll take advice before PR'ing this. Thanks in advance.