tree-sitter/script/build-lib
Patrick Thomson 39bfcdf595 Fix build with MinGW tooling. (#514)
Courtesy of @Eli-Zaretskii, these fixes should unblock people from
building tree-sitter with MinGW.

I don't think this is an unreasonable maintenance burden, especially
given the Emacs project's interest in using tree-sitter, but
@maxbrunsfeld gets the final call.
2020-01-06 09:21:40 -08:00

22 lines
441 B
Bash
Executable file

#!/usr/bin/env bash
# If `CC` isn't set, pick a default compiler
if hash clang 2>/dev/null; then
: ${CC:=clang}
else
: ${CC:=gcc}
fi
${CC} \
-c \
-O3 \
-std=gnu99 \
$CFLAGS \
-I lib/src \
-I lib/include \
lib/src/lib.c \
-o tree-sitter.o
rm -f libtree-sitter.a
ar rcs libtree-sitter.a tree-sitter.o
rm tree-sitter.o