File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 10
10
11
11
import TSCBasic
12
12
import TSCUtility
13
+ import Foundation
13
14
14
15
public class Target : ObjectIdentifierProtocol , PolymorphicCodableProtocol {
15
16
public static var implementations : [ PolymorphicCodableProtocol . Type ] = [
@@ -427,7 +428,8 @@ public final class ClangTarget: Target {
427
428
dependencies: [ Target . Dependency ] = [ ] ,
428
429
buildSettings: BuildSettings . AssignmentTable = . init( )
429
430
) {
430
- assert ( includeDir. contains ( sources. root) , " \( includeDir) should be contained in the source root \( sources. root) " )
431
+
432
+ assert ( includeDir. isDirectory && includeDir. contains ( sources. root) , " \( includeDir) should be contained in the source root \( sources. root) " )
431
433
self . isCXX = sources. containsCXXFiles
432
434
self . cLanguageStandard = cLanguageStandard
433
435
self . cxxLanguageStandard = cxxLanguageStandard
@@ -666,3 +668,12 @@ public enum PluginCapability: Equatable, Codable {
666
668
}
667
669
}
668
670
}
671
+
672
+
673
+ fileprivate extension AbsolutePath {
674
+ var isDirectory : Bool {
675
+ var isDir : ObjCBool = false
676
+ let exists = FileManager . default. fileExists ( atPath: self . pathString, isDirectory: & isDir)
677
+ return exists && isDir. boolValue
678
+ }
679
+ }
You can’t perform that action at this time.
0 commit comments