Home Explore Blog CI



neovim

cmake.deps/cmake/TreesitterParserCMakeLists.txt
d85b9fef252abf1d65b84f5cfcff9519c2a0de1c015c7dce000000030000016a
cmake_minimum_required(VERSION 3.16)
project(parser C)

add_compile_options(-w)

file(GLOB source_files src/*.c)

add_library(parser
  MODULE
  ${source_files}
)
set_target_properties(
  parser
  PROPERTIES
    OUTPUT_NAME ${PARSERLANG}
    PREFIX ""
)

include_directories(src)

install(TARGETS parser LIBRARY DESTINATION lib/nvim/parser)

# vim: set ft=cmake:

Chunks
7c51a0e1 (1st chunk of `cmake.deps/cmake/TreesitterParserCMakeLists.txt`)
Title: CMake Configuration for a Parser Library
Summary
This CMake file configures the build process for a parser library written in C. It sets the minimum CMake version, defines the project name, adds compiler options to suppress warnings, specifies source files, creates a shared library named 'parser' (with a language-specific name based on the PARSERLANG variable), sets library properties (output name, prefix), includes source directories, and defines an installation target to place the library in the 'lib/nvim/parser' directory.