GoogleCloudPlatform / iot-device-sdk-embedded-c

Cloud IoT Device SDK for Connectivity to IoT Core.
Other
247 stars 83 forks source link

Modify Makefiles to compile C++ sources with GCC #13

Closed fredrec closed 5 years ago

atigyi commented 5 years ago

Is the title correct? The modifications seems to make the .cc file compile with g++.

atigyi commented 5 years ago

Does this change convert the project from C project into a C++ project? Why is this necessary? Do we know the consequences? Will the project lose support for any MCU family? Are there MCU SDKs where no g++ is supported?

fredrec commented 5 years ago

Is the title correct? The modifications seems to make the .cc file compile with g++.

I meant GCC as Gnu Compiler Collection, not the C compiler specifically. But granted, this is confusing :)

fredrec commented 5 years ago

Does this change convert the project from C project into a C++ project? Why is this necessary? Do we know the consequences? Will the project lose support for any MCU family? Are there MCU SDKs where no g++ is supported?

This is necessary for parts that depend on C++ libraries (ex: Roughtime). It just compiles those source files using g++ and put the objects into libiotc.a, libstd++ is not linked.

If for any reason someone does not want C++ to be compiled and end up in the library, they should simply no enable features that use C++. If this is an issue, we can create build flags to enable/disable features.

atigyi commented 5 years ago

Mhm, the API of Roughtime lib is C++, right? And this is the reason for C++ compiler need.

DellaBitta commented 5 years ago

Could you please update the overall description of the PR? I'm not quite sure what I'm walking into. :)