projectGenerator icon indicating copy to clipboard operation
projectGenerator copied to clipboard

Multiple flags are correctly read into VS projects, added support for preprocessor definitions in addons

Open brinoausrino opened this issue 6 years ago • 7 comments

Before the project generator only saved the last flag of each type and overwrote the previous ones. This could be fixed by overwriting the first child of the note but not the not itself

from additionalOptions.first_child().set_value to additionalOptions.set_value((std::string(additionalOptions.value()) + " " + cflag).c_str());

Addionally I added the support for preprocessor definitions in addons in VS projects.

brinoausrino avatar Aug 28 '19 15:08 brinoausrino

thanks! looks like a helpful change

ofZach avatar Aug 28 '19 15:08 ofZach

the way overwriting works is by using += if you don't want to overwrite and just = if you want to overwrite, the syntax is based on makefiles syntax and allows to for example overwrite the defaults that are parsed from the file system which is quite useful for certain cases. or i'm understanding this wrong?

Also aren't preprocessir definitions the same as the already present ADDON_DEFINES?

arturoc avatar Aug 29 '19 09:08 arturoc

Yes, this is how it should work. But the project generator for vs overwrites the setting even, when using +=. So I did the fix, that it works how it should.

Yes, you are right. I did not get it that the ADDON_DEFINES should be used for the preprocessor. The had a small bug as well. Fixed it and removed the separate preprocessor definitions

brinoausrino avatar Aug 29 '19 11:08 brinoausrino

not sure what's going on but all the changes you've marked as resolved aren't really there. perhaps you forgot to push?

arturoc avatar Aug 30 '19 13:08 arturoc

not sure what's going on but all the changes you've marked as resolved aren't really there. perhaps you forgot to push?

Did I oversee something (do I need to make a new pull request, or does this work automatically)? The latest commit should resolve the addReplaceStringVector() thing:

https://github.com/openframeworks/projectGenerator/pull/214/commits/37b5cbfbe8342f4faca7ea5e5d9327c3c0544c49

The one before the preprocessor issue

https://github.com/openframeworks/projectGenerator/pull/214/commits/3ff92b5a1a22c3894f048ddcca7abdf0b747cbef

You have any idea?

brinoausrino avatar Aug 30 '19 13:08 brinoausrino

those commits are already in, you don't need to create a new PR i think you are just missing some bits that are still referring to addon preprocessor define. look carefully at my annotations and the line numbers

arturoc avatar Aug 30 '19 15:08 arturoc

sorry arturo, I was a little confused about the codeline. should be fixed now.

brinoausrino avatar Aug 30 '19 19:08 brinoausrino