@@ -12,6 +12,7 @@ import dep
12
12
import POSIX
13
13
import sys
14
14
15
+
15
16
// Initialize the resource support.
16
17
public var globalSymbolInMainBinary = 0
17
18
Resources . initialize ( & globalSymbolInMainBinary)
50
51
try llbuild ( srcroot: pkg. path, targets: try pkg. targets ( ) , dependencies: dependencies, prefix: builddir, tmpdir: Path . join ( builddir, " \( pkg. name) .o " ) , configuration: configuration)
51
52
}
52
53
53
- // build the current directory
54
- try llbuild ( srcroot: rootd, targets: targets, dependencies: dependencies, prefix: builddir, tmpdir: Path . join ( builddir, " \( pkgname) .o " ) , configuration: configuration)
54
+ do {
55
+ // build the current directory
56
+ try llbuild ( srcroot: rootd, targets: targets, dependencies: dependencies, prefix: builddir, tmpdir: Path . join ( builddir, " \( pkgname) .o " ) , configuration: configuration)
57
+ } catch POSIX . Error . ExitStatus( let foo) {
58
+ #if os(Linux)
59
+ // it is a common error on Linux for clang++ to not be installed, but
60
+ // we need it for linking. swiftc itself gives a non-useful error, so
61
+ // we try to help here.
62
+
63
+ //TODO really we should figure out if clang++ is installed in a better way
64
+ // however, since this is an error path, the performance implications are
65
+ // less severe, so it will do for now.
66
+
67
+ if ( try ? popen ( [ " clang++ " , " --version " ] , redirectStandardError: true ) ) == nil {
68
+ print ( " warning: clang++ not found: this will cause build failure " , toStream: & stderr)
69
+ }
70
+ #endif
71
+ throw POSIX . Error. ExitStatus ( foo)
72
+ }
73
+
55
74
56
75
case . Version:
57
76
print ( " Apple Swift Package Manager 0.1 " )
0 commit comments