Skip to content

Commit ea6260d

Browse files
author
Anis Kadri
committed
Merge branch 'feature/fixCompilerFlagsInProjectFile' of https://github.com/Icenium/node-xcode into Icenium-feature/fixCompilerFlagsInProjectFile
2 parents d8094c0 + 7267f77 commit ea6260d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/pbxFile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var path = require('path'),
2+
util = require('util'),
23
M_EXTENSION = /[.]m$/, SOURCE_FILE = 'sourcecode.c.objc',
34
H_EXTENSION = /[.]h$/, HEADER_FILE = 'sourcecode.c.h',
45
BUNDLE_EXTENSION = /[.]bundle$/, BUNDLE = '"wrapper.plug-in"',
@@ -93,7 +94,7 @@ function pbxFile(filepath, opt) {
9394
if (opt.compilerFlags) {
9495
if (!this.settings)
9596
this.settings = {};
96-
this.settings.COMPILER_FLAGS = opt.compilerFlags;
97+
this.settings.COMPILER_FLAGS = util.format('"%s"', opt.compilerFlags);
9798
}
9899
}
99100

test/pbxFile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ exports['settings'] = {
195195

196196
'should be {COMPILER_FLAGS:"blah"} if compiler flags specified': function (test) {
197197
var sourceFile = new pbxFile('Plugins/BarcodeScanner.m',
198-
{ compilerFlags: "-fno-objc-arc" });
198+
{ compilerFlags: "-std=c++11 -fno-objc-arc" });
199199

200-
test.deepEqual({COMPILER_FLAGS:"-fno-objc-arc"}, sourceFile.settings);
200+
test.deepEqual({COMPILER_FLAGS:'"-std=c++11 -fno-objc-arc"'}, sourceFile.settings);
201201
test.done();
202202
}
203203
}

0 commit comments

Comments
 (0)