Domanda

I want to allow a third party to use our static library in debug mode with assertions while they are developing their app but I also want to allow them to use our static library in release mode so they don't have to submit their app to the App Store with assertions. Is there a way to do this without having two separate binaries or is there a best practice for this situation?

È stato utile?

Soluzione

No, you can't. The reason is you would get duplicate symbols. A universal library is also no option, since the OS selects different binaries depending on the current architecture.

You can however build two libraries distinguished by name, e.g.:

libFoo.a and libFoo_debug.a

and ship those two to your clients. Then, the client application will simply link against the respective library (per build settings in "Other Linker Flags") in the Debug and Release Configuration. This setup needs to be made just once.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top