Home Explore Blog CI



neovim

1st chunk of `cmake.deps/CMakeLists.txt`
c827812bbd90c4cd7b056ee87703337ceee24c82876975690000000100000925
# This is not meant to be included by the top-level.
cmake_minimum_required(VERSION 3.16)
project(NVIM_DEPS C)

if(POLICY CMP0135)
  cmake_policy(SET CMP0135 NEW)
endif()

# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")

include(CheckCCompilerFlag)
include(ExternalProject)
include(FindPackageHandleStandardArgs)

include(Deps)
include(Find)
include(Util)

#-------------------------------------------------------------------------------
# User settings
#-------------------------------------------------------------------------------

set(DEPS_IGNORE_SHA FALSE)

# Options
option(USE_BUNDLED "Use bundled dependencies." ON)

option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
option(USE_BUNDLED_LPEG "Use the bundled lpeg." ${USE_BUNDLED})
# PUC Lua is only used for tests, unless explicitly requested.
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
option(USE_BUNDLED_UTF8PROC "Use the bundled utf8proc library." ${USE_BUNDLED})

if(USE_BUNDLED AND MSVC)
  option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
  option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
else()
  option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." OFF)
  option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
endif()

option(ENABLE_WASMTIME "Use treesitter with wasmtime support." OFF)
if(ENABLE_WASMTIME)
  if(USE_BUNDLED)
    option(USE_BUNDLED_WASMTIME "Use the bundled wasmtime." ON)
  else()
    option(USE_BUNDLED_WASMTIME "Use the bundled wasmtime." OFF)
  endif()
endif()
if(NOT ENABLE_WASMTIME AND USE_BUNDLED_WASMTIME)
  message(FATAL_ERROR "ENABLE_WASMTIME is set to OFF while USE_BUNDLED_WASMTIME is set to ON.\
  You need set ENABLE_WASMTIME to ON if you want to use wasmtime.")
endif()

option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source

Title: CMake Script for Managing Neovim Dependencies
Summary
This CMake script manages dependencies for Neovim. It sets the minimum CMake version, project name, and includes necessary modules. It defines options for using bundled versions of various libraries like libuv, lpeg, Lua, LuaJIT, luv, treesitter, unibilium, utf8proc, gettext, libiconv, and wasmtime. It also handles a flag to ignore SHA checks for dependencies and an option to use existing source directories.