Skip to content

Commit 86c5011

Browse files
committed
start of compiler flag support.
1 parent eab037f commit 86c5011

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/pbxFile.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ function pbxFile(filepath, opt) {
8383

8484
if (opt.weak && opt.weak === true)
8585
this.settings = { ATTRIBUTES: ['Weak'] };
86+
87+
if (opt.compilerFlags) {
88+
if (!this.settings)
89+
this.settings = {};
90+
this.settings.COMPILER_FLAGS = opt.compilerFlags;
91+
}
8692
}
8793

8894
module.exports = pbxFile;

test/pbxFile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,13 @@ exports['settings'] = {
191191

192192
test.deepEqual({ATTRIBUTES:["Weak"]}, sourceFile.settings);
193193
test.done();
194+
},
195+
196+
'should be {COMPILER_FLAGS:"blah"} if compiler flags specified': function (test) {
197+
var sourceFile = new pbxFile('Plugins/BarcodeScanner.m',
198+
{ compilerFlags: "-fno-objc-arc" });
199+
200+
test.deepEqual({COMPILER_FLAGS:"-fno-objc-arc"}, sourceFile.settings);
201+
test.done();
194202
}
195203
}

0 commit comments

Comments
 (0)