openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.85k stars 2.55k forks source link

Project Generator for VS and C files #7915

Closed Jonathhhan closed 2 months ago

Jonathhhan commented 3 months ago

When I create a VS solution with the Project Generator, it does not detect if there are any C files (in libs from addons for example). ofxPd with Pure Data is such a case. Or ofxLua with Lua. Now I have to set them manually to be compiled with C. Would it be possible for the Project Generator to detect and set those files automatically (whether C or C++)?

dimitre commented 2 months ago

I'm wondering about simplifying projectGenerator, and eliminate SrcType object, it seems the code is there to handle C files but is never called because addon.csrcFiles is never populated in first place. https://github.com/openframeworks/projectGenerator/blob/22db54d0c4f84ae71a6f09e876c592c5f8779b93/commandLine/src/projects/visualStudioProject.cpp#L223-L236

@Jonathhhan are the files being added? You just have to change them to be compiled in C right? if yes, can you please check the diff in file before and after your change? Thank you

Jonathhhan commented 2 months ago

are the files being added? You just have to change them to be compiled in C right? if yes, can you please check the diff in file before and after your change? Thank you

Yes, thats the case. I will try and check the diff.

Jonathhhan commented 2 months ago

My fault. The default in VS was C++ and I had to set it to standard.