Skip to content

Commit

Permalink
feat(cli/cordova): add support for source-file compiler-flags attribu…
Browse files Browse the repository at this point in the history
…te (#2237)
  • Loading branch information
jcesarmobile authored Dec 11, 2019
1 parent 94879b3 commit 8549141
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cli/src/ios/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ async function generateCordovaPodspec(cordovaPlugins: Plugin[], config: Config,
let systemLibraries: Array<string> = [];
let sourceFrameworks: Array<string> = [];
let frameworkDeps: Array<string> = [];
let compilerFlags: Array<string> = [];
let name = 'CordovaPlugins';
let sourcesFolderName = 'sources';
if (isStatic) {
Expand Down Expand Up @@ -195,6 +196,11 @@ async function generateCordovaPodspec(cordovaPlugins: Plugin[], config: Config,
if (!sourceFrameworks.includes(frameworktPath)) {
sourceFrameworks.push(frameworktPath);
}
} else if (sourceFile.$['compiler-flags']) {
const cFlag = sourceFile.$['compiler-flags'];
if (!compilerFlags.includes(cFlag)) {
compilerFlags.push(cFlag);
}
}
});
});
Expand All @@ -213,6 +219,9 @@ async function generateCordovaPodspec(cordovaPlugins: Plugin[], config: Config,
if (sourceFrameworks.length > 0) {
frameworkDeps.push(`s.vendored_libraries = '${sourceFrameworks.join(`', '`)}'`);
}
if (compilerFlags.length > 0) {
frameworkDeps.push(`s.compiler_flags = '${compilerFlags.join(' ')}'`);
}
const arcPlugins = cordovaPlugins.filter(filterARCFiles);
if (arcPlugins.length > 0) {
frameworkDeps.push(`s.subspec 'noarc' do |sna|
Expand Down

0 comments on commit 8549141

Please sign in to comment.