I'm trying to include this module map as a system library target. (Note that adding this github project as a dependency already works perfectly.)
<project> | - Sources | - <swift files> | - graphqlparser | - module.modulemap
But receiving the following error when building/generating xcodeproj:
$ swift package -Xswiftc -I/usr/local/include/graphqlparser/ -Xlinker -L/usr/local/lib generate-xcodeproj 'GraphQLParserSwift' /Users/<Me>/Documents/projects/graphql-parser-swift: **error:** package has unsupported layout; modulemap '/Users/<Me>/Documents/projects/graphql-parser-swift/Sources/graphqlparser/module.modulemap' should be inside the 'include' directory
Package.swift is this
// swift-tools-version:4.2 import PackageDescription let package = Package( name: "GraphQLParserSwift", products: [ .library( name: "GraphQLParserSwift", targets: ["GraphQLParserSwift"]) ], targets: [ .target( name: "GraphQLParserSwift", dependencies: ["CGraphQLParser"], path: "Sources"), .systemLibrary( name: "CGraphQLParser", path: "Sources/graphqlparser"), // pkgConfig: "libgraphqlparser", this needs to be added to homebrew, open a PR. // providers: [ // .brew(["libgraphqlparser"]), // .apt(["libgraphqlparser"]), // ] // ), .testTarget( name: "GraphQLParserSwiftTests", dependencies: ["GraphQLParserSwift", "CGraphQLParser"], path: "Tests") ], swiftLanguageVersions: [.v4_2] )
I also looked at this guide but it seems like the setup is somewhat different. Also curious if I could move the linux vs mac header files into a
graphqlparser.h header but first just want to get this to work as-is.