build: fix build warning when using gcc 4.9.2

Problem:
When building with gcc 4.9.2, tree-sitter throws warning: "for loop initial
declarations are only allowed in C99 or C11 mode"

Solution:
set CMAKE_C_STANDARD option to 99
This commit is contained in:
red 2023-03-09 23:46:34 +08:00 committed by GitHub
parent 9ef7297ef1
commit 64d3f68c07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(tree-sitter C)
set(CMAKE_C_STANDARD 99)
add_library(tree-sitter lib/src/lib.c)
target_include_directories(tree-sitter
PRIVATE lib/src lib/include)