-
-
Save stephencelis/7f76f8d26a1df64ee3ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define __STDC_CONSTANT_MACROS | |
#define __STDC_LIMIT_MACROS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CLLVM [extern_c] [system] { | |
header "defines.h" | |
header "/usr/local/opt/llvm/include/llvm-c/Analysis.h" | |
header "/usr/local/opt/llvm/include/llvm-c/Core.h" | |
header "/usr/local/opt/llvm/include/llvm/Support/DataTypes.h" | |
header "/usr/local/opt/llvm/include/llvm-c/Support.h" | |
link "c++" | |
link "curses" | |
link "m" | |
link "pthread" | |
link "z" | |
// .a, unlike .dylib and .so, isn't picked up by swiftpm | |
// link "LLVMAnalysis" | |
// link "LLVMCore" | |
// link "LLVMMC" | |
// link "LLVMSupport" | |
// link "LLVMTarget" | |
export * | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOOLCHAIN = /Library/Developer/Toolchains/swift-latest.xctoolchain | |
SPM = ${TOOLCHAIN}/usr/bin/swift build | |
LLVM_PATH = /usr/local/opt/llvm | |
LLVM_INCLUDE = ${LLVM_PATH}/include | |
LLVM_LIB = ${LLVM_PATH}/lib | |
LLVM_STATIC_LIBRARIES += Analysis Core MC Support Target | |
SPM_FLAGS = \ | |
-Xcc -I${LLVM_INCLUDE} \ | |
-Xlinker -L${LLVM_LIB} \ | |
$(addprefix -Xlinker -lLLVM,${LLVM_STATIC_LIBRARIES}) \ | |
-vv \ | |
all: | |
${SPM} ${SPM_FLAGS} | |
clean: | |
${SPM} --clean=dist | |
.PHONY: clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment