fix(cli): add cSettings support for compiler flags in generated Package.swift#8448
fix(cli): add cSettings support for compiler flags in generated Package.swift#8448OS-ruimoreiramendes wants to merge 5 commits intomainfrom
Conversation
|
Minor: I think the PR title should be |
|
@OS-ruimoreiramendes could you provide instructions on how to test this? |
Any plugin with |
jcesarmobile
left a comment
There was a problem hiding this comment.
Since it only handles compiler flags starting with -D, might be good to warn when there are compiler flags that don't get added, as if those flags are needed and are not added (and can't be added since most are unsafe), will most likely lead to the plugin not compiling, in example compiler-flags="-fno-objc-arc" is relatively common in old plugins and it's unsafe, so we can't add it, but the code won't compile without it, so a warning will give a hint.
will add a warn message for compiler flags that don't get added |
…added to Package.swift
|
Why do you make such big refactor when the PR was already approved?
If none of the compiler flags is one of the "safe" ones and none get added to the If the compiler flag is Also in the warning maybe use |
I follow the same approach you suggested on #8445 (comment). However, thinking about it more carefully, it might not have been the best idea to do this refactor here after the PR was already approved. |
|
I prefer to finish this one since I already approved it, but address the latest comments I made. |
Done, take another look when you can. |
jcesarmobile
left a comment
There was a problem hiding this comment.
I've tested and the unsafeFlags actually work when the packages are local, but since for Cordova plugins they are added per file rather than for the whole plugin and it's not desirable to add things such as -fno-objc-arc to the whole plugin and for us supporting it it would require to put the files in separate targets (as we do for CocoaPods), so let's not do it for now, but keep it in mind in case users report it as a problem.
Parse
compiler-flagsfromplugin.xmland generatecSettingsin the SPM Package.swift.Note: this PR will likely conflict with RMET-5159 (#8443) in the
generateCordovaPackageFilefunction, as both PRs declareconst sourceFilesin the same else block. Easy to resolve.Reference: https://outsystemsrd.atlassian.net/browse/RMET-5161