Skip to content

Instantly share code, notes, and snippets.

@emlai
Last active November 5, 2016 14:18
Show Gist options
  • Save emlai/cf629399b89bec5a60f7e72ec2e08073 to your computer and use it in GitHub Desktop.
Save emlai/cf629399b89bec5a60f7e72ec2e08073 to your computer and use it in GitHub Desktop.
MCVE of "error: in auto-import: failed to get module 'foo' from AST context"
.DS_Store
/.build
/Packages
/*.xcodeproj
import LLVM_C.Core
func foo(_ a: Int) {
let b = a * a
print(b)
}
foo(4)
all:
@swift build \
-Xcc -I`llvm-config --includedir` \
-Xlinker -L`llvm-config --libdir` \
-Xlinker -rpath -Xlinker `llvm-config --libdir`
import PackageDescription
let package = Package(
name: "foo",
dependencies: [
.Package(url: "https://github.com/rxwei/LLVM_C", majorVersion: 1, minor: 0)
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment