They use CMake, so I'm translating CMake to SwiftPM.
Thier CMakeLists.txt file uses the CMake check_symbol_exists command to define a macro named HAVE_MEMSET_S if memset_s is available in the system's libc string.h header file.
Is it possible to do that with Swift Package Manger?
Yeah, I saw that. OK. Thanks, @NeoNacho. I was also wondering if it's possible to define a macro if the system is big endian, but I guess not. Oh well.
I don't think there is. The main conceptual issue with a query like this is while the manifest can run arbitrary Swift code, it will be run on the host, so any sort of queries like that would give you answers about macOS/Linux, not necessarily the target platform you are building for.
Wow, I didn't know the manifest could run arbitrary Swift code. I initially figured it could, but then I got a parse error or something when I tried it. But I just tried it again, and it worked! That's so awesome! Thanks! :-) Oh yeah, good point. Hmm... maybe the check_symbol_exists and test_big_endian commands in libsignal-protocol-c's CMakeLists.txt file have the same issue. By the way, I just realized that I've seen you talking about the Swift Package Manager from Apple's WWDC videos. Great job! I thought you seemed familiar. Thanks for your contributions. :-) And thanks so much for answering my questions. SwiftPM is really cool!