forked from neovim/neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(build): include lpeg as a library
- Loading branch information
Showing
19 changed files
with
376 additions
and
52 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/scripts | ||
/src | ||
/test | ||
/runtime/lua/vim/re.lua |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
list(APPEND LPEG_CMAKE_ARGS "-DCMAKE_C_FLAGS:STRING=${DEPS_INCLUDE_FLAGS}") | ||
|
||
ExternalProject_Add(lpeg | ||
URL ${LPEG_URL} | ||
URL_HASH SHA256=${LPEG_SHA256} | ||
DOWNLOAD_NO_PROGRESS TRUE | ||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lpeg | ||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy | ||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LpegCMakeLists.txt | ||
${DEPS_BUILD_DIR}/src/lpeg/CMakeLists.txt | ||
CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${LPEG_CMAKE_ARGS} | ||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) | ||
|
||
if(USE_BUNDLED_LUAJIT) | ||
add_dependencies(lpeg luajit) | ||
elseif(USE_BUNDLED_LUA) | ||
add_dependencies(lpeg lua) | ||
endif() |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project (lpeg C) | ||
|
||
include(GNUInstallDirs) | ||
|
||
file(GLOB LPEG_SOURCES ${CMAKE_SOURCE_DIR}/*.c) | ||
add_library(lpeg ${LPEG_SOURCES}) | ||
|
||
install(TARGETS lpeg ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
|
||
# vim: set ft=cmake: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
find_library(LPEG_LIBRARY NAMES lpeg_a lpeg liblpeg_a) | ||
|
||
# Ubuntu-specific workaround to find system paths | ||
function(ubuntu) | ||
set(CMAKE_FIND_LIBRARY_PREFIXES "") | ||
find_library(LPEG_LIBRARY NAMES lpeg PATH_SUFFIXES lua/5.1) | ||
endfunction() | ||
ubuntu() | ||
|
||
find_package_handle_standard_args(Lpeg DEFAULT_MSG LPEG_LIBRARY) | ||
mark_as_advanced(LPEG_LIBRARY) | ||
|
||
add_library(lpeg INTERFACE) | ||
target_link_libraries(lpeg INTERFACE ${LPEG_LIBRARY}) |
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
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
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
Oops, something went wrong.