Post

Replies

Boosts

Views

Activity

Packaging C libs as framework, good idea? If so I have questions
We bit the bullet of massaging our CMake stuff to package our cross-platform SDK library & C headers as a framework for Mac & iOS. Assuming this is indeed a sensible thing to do, our cross-platform examples and our end users' code now need "#if APPLE / #include <Thingie/header.h> / #else / #include <header.h>", and to setup framework search paths instead of header search paths for this SDK. Question 1: Is it definite that <Thingie/header.h> is going to be necessary when using the framework, and there's no special cases where "#include <header.h>" also finds headers within frameworks for C/C++ code? Question 2: For macOS projects specifically, how janky is it to add "Thingie.framework/Headers" to the C/C++ header search paths (instead of setting the framework search path) so that such ifdefs around the includes aren't needed. Is this even a remotely-common practice or is it super ugly, and/or hazardous for any reason? Question 3: Do Mac SDKs always do one or the other, embrace framework or have lib and loose headers fully cross-platform-wise? Does anyone else ever include the latter like the windows/linux variants of their SDKs, but also package a framework and let macOS users choose either option? Thanks!
2
0
839
Aug ’22