Stay backwards compatible with cflags, cxxflags, ldflags
#24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
5e173ae (related to #22) changed API regarding
cflags, cxxflags, ldflags
Previously it was expected to be raw and passed as is, thus applications could do either
And both would work and do exactly same thing. But 5e173ae made that each item is a separate flag thus you couldn't put multiple flags in same string so only 2nd way would work.
I don't think that previous API is good because it's 2 ways to do exactly same thing and you would have to escape it for target shell yourself and it's something that's easy to forget, eg.
ldflags << "-L" << libpath
- this actually wouldn't work iflibpath
contained spaces and weren't escaped for shell.But there's probably a lot of applications that are passing multiple flags in single string so to make life easier for everyone lets just keep API compatibility.
And for new applications they can disable this compatibility with
raw = false
like this