File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -546,7 +546,11 @@ pbxProject.prototype.addToLibrarySearchPaths = function (file) {
546546 buildSettings [ 'LIBRARY_SEARCH_PATHS' ] = [ INHERITED ] ;
547547 }
548548
549- buildSettings [ 'LIBRARY_SEARCH_PATHS' ] . push ( searchPathForFile ( file , this ) ) ;
549+ if ( typeof file === 'string' ) {
550+ buildSettings [ 'LIBRARY_SEARCH_PATHS' ] . push ( file ) ;
551+ } else {
552+ buildSettings [ 'LIBRARY_SEARCH_PATHS' ] . push ( searchPathForFile ( file , this ) ) ;
553+ }
550554 }
551555}
552556
@@ -590,7 +594,11 @@ pbxProject.prototype.addToHeaderSearchPaths = function (file) {
590594 buildSettings [ 'HEADER_SEARCH_PATHS' ] = [ INHERITED ] ;
591595 }
592596
593- buildSettings [ 'HEADER_SEARCH_PATHS' ] . push ( searchPathForFile ( file , this ) ) ;
597+ if ( typeof file === 'string' ) {
598+ buildSettings [ 'HEADER_SEARCH_PATHS' ] . push ( file ) ;
599+ } else {
600+ buildSettings [ 'HEADER_SEARCH_PATHS' ] . push ( searchPathForFile ( file , this ) ) ;
601+ }
594602 }
595603}
596604// a JS getter. hmmm
Original file line number Diff line number Diff line change @@ -28,6 +28,17 @@ exports.addAndRemoveToFromHeaderSearchPaths = {
2828 }
2929 test . done ( ) ;
3030 } ,
31+ 'add should not mangle string arguments and add to each config section' :function ( test ) {
32+ var includePath = '../../some/path' ;
33+ proj . addToHeaderSearchPaths ( includePath ) ;
34+ var config = proj . pbxXCBuildConfigurationSection ( ) ;
35+ for ( var ref in config ) {
36+ if ( ref . indexOf ( '_comment' ) > - 1 || config [ ref ] . buildSettings . PRODUCT_NAME != PRODUCT_NAME ) continue ;
37+ var lib = config [ ref ] . buildSettings . HEADER_SEARCH_PATHS ;
38+ test . ok ( lib [ 1 ] . indexOf ( includePath ) > - 1 ) ;
39+ }
40+ test . done ( ) ;
41+ } ,
3142 'remove should remove from the path to each configuration section' :function ( test ) {
3243 var libPath = 'some/path/include' ;
3344 proj . addToHeaderSearchPaths ( {
Original file line number Diff line number Diff line change @@ -28,6 +28,17 @@ exports.addAndRemoveToFromLibrarySearchPaths = {
2828 }
2929 test . done ( ) ;
3030 } ,
31+ 'add should not mangle string arguments and add to each config section' :function ( test ) {
32+ var libPath = '../../some/path' ;
33+ proj . addToLibrarySearchPaths ( libPath ) ;
34+ var config = proj . pbxXCBuildConfigurationSection ( ) ;
35+ for ( var ref in config ) {
36+ if ( ref . indexOf ( '_comment' ) > - 1 || config [ ref ] . buildSettings . PRODUCT_NAME != PRODUCT_NAME ) continue ;
37+ var lib = config [ ref ] . buildSettings . LIBRARY_SEARCH_PATHS ;
38+ test . ok ( lib [ 1 ] . indexOf ( libPath ) > - 1 ) ;
39+ }
40+ test . done ( ) ;
41+ } ,
3142 'remove should remove from the path to each configuration section' :function ( test ) {
3243 var libPath = 'some/path/poop.a' ;
3344 proj . addToLibrarySearchPaths ( {
You can’t perform that action at this time.
0 commit comments