lundi 5 janvier 2015

Mixing C and C++ sources in cmake

I am trying to compile a C and C++ source codes. Currently I am using c++0x standard for C++ by adding this line to the cmake file add_definitions(-std=c++0x).


During the compilation, I get the following warning: cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [enabled by default] and this error: error: ‘for’ loop initial declarations are only allowed in C99 mode referred to a for loop in the c code.


I am wondering how can I set a standard for c code in the cmake file.


Aucun commentaire:

Enregistrer un commentaire