Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions XCode/PBXFrameworksBuildPhase.m
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,22 @@ - (NSString *) linkString
linkString = [linkString stringByAppendingString: [NSString stringWithFormat: @"-L%@ ", lpath]];
}

// Other targets' products (e.g. static libraries) live in build/<target>/Products.
NSArray *buildSubdirs = [manager contentsOfDirectoryAtPath: @"build" error: NULL];
en = [[buildSubdirs sortedArrayUsingSelector: @selector(compare:)] objectEnumerator];
while((lpath = [en nextObject]) != nil)
{
NSString *productsDir = [[@"build" stringByAppendingPathComponent: lpath]
stringByAppendingPathComponent: @"Products"];
BOOL isDir = NO;
if ([manager fileExistsAtPath: productsDir isDirectory: &isDir] && isDir
&& [productsDir isEqualToString: uninstalledProductsDir] == NO)
{
linkString = [linkString stringByAppendingFormat: @"-L%@ ",
[productsDir stringByEscapingSpecialCharacters]];
}
}

en = [_files objectEnumerator];
while((file = [en nextObject]) != nil)
{
Expand Down
3 changes: 3 additions & 0 deletions XCode/PBXNativeTarget.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ - (void) _productWrapper
forKey: @"TARGET_BUILD_DIR"];
[context setObject: aname
forKey: @"TARGET_NAME"];
[context setObject: @"derived_src"
forKey: @"PROJECT_DERIVED_FILE_DIR"];
setenv("PROJECT_DERIVED_FILE_DIR","derived_src",1);
[context setObject: uninstalledProductsDir
forKey: @"BUILT_PRODUCTS_DIR"];

Expand Down
2 changes: 1 addition & 1 deletion XCode/PBXShellScriptBuildPhase.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ - (NSString *) contextString
NSString *k = nil;

result = [result stringByAppendingString: @"set -eo pipefail\n"
@"shopt -s inherit_errexit\n\n"];
@"shopt -s inherit_errexit 2>/dev/null || true\n\n"];

while ((k = [en nextObject]) != nil)
{
Expand Down
2 changes: 1 addition & 1 deletion XCode/xcsystem.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ NSInteger xcsystem(NSString *cmd)
{
NSString *scriptFormat = @"#!/bin/bash\n"
@"set -eo pipefail\n"
@"shopt -s inherit_errexit\n\n"
@"shopt -s inherit_errexit 2>/dev/null || true\n\n"
@"%@\n\n"
@"exit $?\n";
NSString *body = @"";
Expand Down
Loading