On 02/24/2015 11:33 AM, Thiago Macieira wrote: > Hello all > > I talked to Pat here at the OIC meeting and we came to the conclusion that > both the C and C++ parts of the core (discovery, connectivity & security) > codebase should be in one single library. Therefore, we propose two build > modes: > > ==== Proposal ==== > > 1) shared library: libiotivity.so.1 / iotivity1.dll, thread-safe, including > both parts and linking to the C++ runtime. Implies -fPIC and - > fvisibility=hidden.
[SNIP] > On systems where a single application runs IoTivity, the static library > should > be the one used. This includes memory-constrained devices, whether they run > Linux or not. For the same reason, the C SDK portion of the static library > should not trigger require the C++ runtime and should have minimal external > dependencies. > > Systems without support for threads are expected to be very memory > constrained. Therefore, only the static library should be enabled. In other > words, disabling thread support should disable the C++ layer and the dynamic > library too. This seems to me that a separation between C and C++ parts of the core might be warranted. For the single-threaded case that would mean not building the C++ lib. The current proposal of a single library would presumably address this by merely selectively disabling inclusion of the C++ code by build configuration wizardry. Making the C and C++ parts into two libraries would simply build configuration and maintenance. However our codebase is probably small enough not to require this complexity yet. Then later we could split into two libs and perhaps a compatibility lib that keeps the original name but references both of the new ones. Thus we can start with the single library, but with a LEAN_AND_MEAN, or MINIMAL config option that turns off both single-threaded and C++ code plus disabling the build of a dynamic lib. And end-user/developer convenience would be the strong point in favor of the single unified lib. -- Jon A. Cruz - Senior Open Source Developer Samsung Open Source Group jonc at osg.samsung.com
