mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
build: Rename NEOVIM_* to NVIM_*
This commit is contained in:
parent
62774e4356
commit
e20e9645b2
@ -47,8 +47,8 @@ include_directories(${GENERATED_INCLUDES_DIR})
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR})
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR})
|
||||
|
||||
file(GLOB NEOVIM_SOURCES *.c)
|
||||
file(GLOB NEOVIM_HEADERS *.h)
|
||||
file(GLOB NVIM_SOURCES *.c)
|
||||
file(GLOB NVIM_HEADERS *.h)
|
||||
|
||||
foreach(subdir
|
||||
os
|
||||
@ -67,18 +67,18 @@ foreach(subdir
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/${subdir})
|
||||
file(GLOB sources ${subdir}/*.c)
|
||||
file(GLOB headers ${subdir}/*.h)
|
||||
list(APPEND NEOVIM_SOURCES ${sources})
|
||||
list(APPEND NEOVIM_HEADERS ${headers})
|
||||
list(APPEND NVIM_SOURCES ${sources})
|
||||
list(APPEND NVIM_HEADERS ${headers})
|
||||
endforeach()
|
||||
|
||||
file(GLOB UNIT_TEST_FIXTURES ${PROJECT_SOURCE_DIR}/test/unit/fixtures/*.c)
|
||||
|
||||
# Sort file lists to ensure generated files are created in the same order from
|
||||
# build to build.
|
||||
list(SORT NEOVIM_SOURCES)
|
||||
list(SORT NEOVIM_HEADERS)
|
||||
list(SORT NVIM_SOURCES)
|
||||
list(SORT NVIM_HEADERS)
|
||||
|
||||
foreach(sfile ${NEOVIM_SOURCES})
|
||||
foreach(sfile ${NVIM_SOURCES})
|
||||
get_filename_component(f ${sfile} NAME)
|
||||
if(${f} MATCHES "^(regexp_nfa.c)$")
|
||||
list(APPEND to_remove ${sfile})
|
||||
@ -88,7 +88,7 @@ foreach(sfile ${NEOVIM_SOURCES})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_ITEM NEOVIM_SOURCES ${to_remove})
|
||||
list(REMOVE_ITEM NVIM_SOURCES ${to_remove})
|
||||
|
||||
# Legacy files that do not yet pass -Wconversion.
|
||||
set(CONV_SOURCES
|
||||
@ -162,12 +162,11 @@ function(get_preproc_output varname iname)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# NEOVIM_GENERATED_FOR_HEADERS: header files generated to be included in headers
|
||||
# NEOVIM_GENERATED_FOR_SOURCES: header files generated to be included in sources
|
||||
# NEOVIM_GENERATED_SOURCES: generated source files
|
||||
# These lists should be mutually exclusive
|
||||
|
||||
foreach(sfile ${NEOVIM_SOURCES}
|
||||
# NVIM_GENERATED_FOR_HEADERS: generated headers to be included in headers
|
||||
# NVIM_GENERATED_FOR_SOURCES: generated headers to be included in sources
|
||||
# NVIM_GENERATED_SOURCES: generated source files
|
||||
# These lists must be mutually exclusive.
|
||||
foreach(sfile ${NVIM_SOURCES}
|
||||
"${PROJECT_SOURCE_DIR}/src/nvim/regexp_nfa.c"
|
||||
${GENERATED_API_DISPATCH})
|
||||
get_filename_component(full_d ${sfile} PATH)
|
||||
@ -193,8 +192,8 @@ foreach(sfile ${NEOVIM_SOURCES}
|
||||
COMMAND "${LUA_PRG}" "${HEADER_GENERATOR}" "${sfile}" "${gf_c_h}" "${gf_h_h}" "${gf_i}"
|
||||
DEPENDS "${HEADER_GENERATOR}" "${sfile}"
|
||||
)
|
||||
list(APPEND NEOVIM_GENERATED_FOR_SOURCES "${gf_c_h}")
|
||||
list(APPEND NEOVIM_GENERATED_FOR_HEADERS "${gf_h_h}")
|
||||
list(APPEND NVIM_GENERATED_FOR_SOURCES "${gf_c_h}")
|
||||
list(APPEND NVIM_GENERATED_FOR_HEADERS "${gf_h_h}")
|
||||
if(${d} MATCHES "^api$" AND NOT ${f} MATCHES "^api/helpers.c$")
|
||||
list(APPEND API_HEADERS ${gf_h_h})
|
||||
endif()
|
||||
@ -221,12 +220,12 @@ add_custom_command(OUTPUT ${GENERATED_API_DISPATCH} ${GENERATED_FUNCS_METADATA}
|
||||
${CMAKE_CURRENT_LIST_DIR}/api/dispatch_deprecated.lua
|
||||
)
|
||||
|
||||
list(APPEND NEOVIM_GENERATED_FOR_HEADERS
|
||||
list(APPEND NVIM_GENERATED_FOR_HEADERS
|
||||
"${GENERATED_EX_CMDS_ENUM}"
|
||||
"${GENERATED_EVENTS_ENUM}"
|
||||
)
|
||||
|
||||
list(APPEND NEOVIM_GENERATED_FOR_SOURCES
|
||||
list(APPEND NVIM_GENERATED_FOR_SOURCES
|
||||
"${GENERATED_API_DISPATCH}"
|
||||
"${GENERATED_EX_CMDS_DEFS}"
|
||||
"${GENERATED_EVENTS_NAMES_MAP}"
|
||||
@ -234,7 +233,7 @@ list(APPEND NEOVIM_GENERATED_FOR_SOURCES
|
||||
"${GENERATED_UNICODE_TABLES}"
|
||||
)
|
||||
|
||||
list(APPEND NEOVIM_GENERATED_SOURCES
|
||||
list(APPEND NVIM_GENERATED_SOURCES
|
||||
"${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
|
||||
)
|
||||
|
||||
@ -254,7 +253,7 @@ add_custom_command(OUTPUT ${GENERATED_FUNCS} ${FUNCS_DATA}
|
||||
${GENERATED_FUNCS_HASH_INPUT} --output-file=${GENERATED_FUNCS}
|
||||
DEPENDS ${FUNCS_GENERATOR} ${EVAL_DEFS_FILE} ${API_METADATA}
|
||||
)
|
||||
list(APPEND NEOVIM_GENERATED_FOR_SOURCES
|
||||
list(APPEND NVIM_GENERATED_FOR_SOURCES
|
||||
"${GENERATED_FUNCS}")
|
||||
|
||||
add_custom_command(OUTPUT ${GENERATED_EVENTS_ENUM} ${GENERATED_EVENTS_NAMES_MAP}
|
||||
@ -269,12 +268,11 @@ add_custom_command(OUTPUT ${GENERATED_OPTIONS}
|
||||
DEPENDS ${OPTIONS_GENERATOR} ${OPTIONS_LIST_FILE}
|
||||
)
|
||||
|
||||
# Check that NEOVIM_GENERATED_FOR_SOURCES and NEOVIM_GENERATED_FOR_HEADERS are mutually exclusive
|
||||
|
||||
foreach(hfile ${NEOVIM_GENERATED_FOR_HEADERS})
|
||||
list(FIND NEOVIM_GENERATED_FOR_SOURCES ${hfile} hfile_idx)
|
||||
# NVIM_GENERATED_FOR_SOURCES and NVIM_GENERATED_FOR_HEADERS must be mutually exclusive.
|
||||
foreach(hfile ${NVIM_GENERATED_FOR_HEADERS})
|
||||
list(FIND NVIM_GENERATED_FOR_SOURCES ${hfile} hfile_idx)
|
||||
if(NOT ${hfile_idx} EQUAL -1)
|
||||
message(FATAL_ERROR "File included in both NEOVIM_GENERATED_FOR_HEADERS and NEOVIM_GENERATED_FOR_SOURCES")
|
||||
message(FATAL_ERROR "File included in both NVIM_GENERATED_FOR_HEADERS and NVIM_GENERATED_FOR_SOURCES")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@ -312,8 +310,8 @@ if(JEMALLOC_FOUND)
|
||||
list(APPEND NVIM_EXEC_LINK_LIBRARIES ${JEMALLOC_LIBRARIES})
|
||||
endif()
|
||||
|
||||
add_executable(nvim ${NEOVIM_GENERATED_FOR_SOURCES} ${NEOVIM_GENERATED_FOR_HEADERS}
|
||||
${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} ${NEOVIM_HEADERS})
|
||||
add_executable(nvim ${NVIM_GENERATED_FOR_SOURCES} ${NVIM_GENERATED_FOR_HEADERS}
|
||||
${NVIM_GENERATED_SOURCES} ${NVIM_SOURCES} ${NVIM_HEADERS})
|
||||
target_link_libraries(nvim ${NVIM_EXEC_LINK_LIBRARIES})
|
||||
install_helper(TARGETS nvim)
|
||||
|
||||
@ -387,16 +385,16 @@ elseif(CLANG_TSAN)
|
||||
set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=thread ")
|
||||
endif()
|
||||
|
||||
add_library(libnvim STATIC EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_FOR_SOURCES} ${NEOVIM_GENERATED_FOR_HEADERS}
|
||||
${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} ${NEOVIM_HEADERS})
|
||||
add_library(libnvim STATIC EXCLUDE_FROM_ALL ${NVIM_GENERATED_FOR_SOURCES} ${NVIM_GENERATED_FOR_HEADERS}
|
||||
${NVIM_GENERATED_SOURCES} ${NVIM_SOURCES} ${NVIM_HEADERS})
|
||||
target_link_libraries(libnvim ${NVIM_LINK_LIBRARIES})
|
||||
set_target_properties(libnvim PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
OUTPUT_NAME nvim)
|
||||
set_property(TARGET libnvim APPEND_STRING PROPERTY COMPILE_FLAGS " -DMAKE_LIB ")
|
||||
|
||||
add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_FOR_SOURCES} ${NEOVIM_GENERATED_FOR_HEADERS}
|
||||
${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} ${UNIT_TEST_FIXTURES} ${NEOVIM_HEADERS})
|
||||
add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NVIM_GENERATED_FOR_SOURCES} ${NVIM_GENERATED_FOR_HEADERS}
|
||||
${NVIM_GENERATED_SOURCES} ${NVIM_SOURCES} ${UNIT_TEST_FIXTURES} ${NVIM_HEADERS})
|
||||
target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES})
|
||||
set_property(TARGET nvim-test APPEND_STRING PROPERTY COMPILE_FLAGS -DUNIT_TESTING)
|
||||
|
||||
@ -450,7 +448,7 @@ set(NO_SINGLE_CHECK_HEADERS
|
||||
version
|
||||
window
|
||||
)
|
||||
foreach(hfile ${NEOVIM_HEADERS})
|
||||
foreach(hfile ${NVIM_HEADERS})
|
||||
get_filename_component(full_d ${hfile} PATH)
|
||||
file(RELATIVE_PATH d "${PROJECT_SOURCE_DIR}/src/nvim" "${full_d}")
|
||||
if(${d} MATCHES "^[.][.]")
|
||||
@ -470,7 +468,7 @@ foreach(hfile ${NEOVIM_HEADERS})
|
||||
add_executable(
|
||||
${texe}
|
||||
EXCLUDE_FROM_ALL
|
||||
${tsource} ${NEOVIM_HEADERS} ${NEOVIM_GENERATED_FOR_HEADERS})
|
||||
${tsource} ${NVIM_HEADERS} ${NVIM_GENERATED_FOR_HEADERS})
|
||||
|
||||
list(FIND NO_SINGLE_CHECK_HEADERS "${r}" hfile_exclude_idx)
|
||||
if(${hfile_exclude_idx} EQUAL -1)
|
||||
|
@ -32,10 +32,10 @@ if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG)
|
||||
zh_CN.UTF-8
|
||||
zh_TW.UTF-8)
|
||||
|
||||
set(NEOVIM_RELATIVE_SOURCES)
|
||||
foreach(SRC ${NEOVIM_SOURCES} ${NEOVIM_HEADERS})
|
||||
set(NVIM_RELATIVE_SOURCES)
|
||||
foreach(SRC ${NVIM_SOURCES} ${NVIM_HEADERS})
|
||||
file(RELATIVE_PATH RELATIVE_SRC ${CMAKE_CURRENT_SOURCE_DIR} ${SRC})
|
||||
list(APPEND NEOVIM_RELATIVE_SOURCES ${RELATIVE_SRC})
|
||||
list(APPEND NVIM_RELATIVE_SOURCES ${RELATIVE_SRC})
|
||||
endforeach()
|
||||
|
||||
set(NVIM_POT ${CMAKE_CURRENT_BINARY_DIR}/nvim.pot)
|
||||
@ -46,9 +46,9 @@ if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG)
|
||||
-DXGETTEXT_PRG=${XGETTEXT_PRG}
|
||||
-DPOT_FILE=${NVIM_POT}
|
||||
-DSEARCH_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
"\"-DSOURCES=${NEOVIM_RELATIVE_SOURCES}\""
|
||||
"\"-DSOURCES=${NVIM_RELATIVE_SOURCES}\""
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunXgettext.cmake
|
||||
DEPENDS ${NEOVIM_SOURCES})
|
||||
DEPENDS ${NVIM_SOURCES})
|
||||
|
||||
add_custom_target(potfile DEPENDS ${NVIM_POT})
|
||||
|
||||
|
@ -35,17 +35,17 @@ describe('env function', function()
|
||||
local OK = 0
|
||||
|
||||
itp('sets an env variable and returns OK', function()
|
||||
local name = 'NEOVIM_UNIT_TEST_SETENV_1N'
|
||||
local value = 'NEOVIM_UNIT_TEST_SETENV_1V'
|
||||
local name = 'NVIM_UNIT_TEST_SETENV_1N'
|
||||
local value = 'NVIM_UNIT_TEST_SETENV_1V'
|
||||
eq(nil, os.getenv(name))
|
||||
eq(OK, (os_setenv(name, value, 1)))
|
||||
eq(value, os.getenv(name))
|
||||
end)
|
||||
|
||||
itp("dosn't overwrite an env variable if overwrite is 0", function()
|
||||
local name = 'NEOVIM_UNIT_TEST_SETENV_2N'
|
||||
local value = 'NEOVIM_UNIT_TEST_SETENV_2V'
|
||||
local value_updated = 'NEOVIM_UNIT_TEST_SETENV_2V_UPDATED'
|
||||
local name = 'NVIM_UNIT_TEST_SETENV_2N'
|
||||
local value = 'NVIM_UNIT_TEST_SETENV_2V'
|
||||
local value_updated = 'NVIM_UNIT_TEST_SETENV_2V_UPDATED'
|
||||
eq(OK, (os_setenv(name, value, 0)))
|
||||
eq(value, os.getenv(name))
|
||||
eq(OK, (os_setenv(name, value_updated, 0)))
|
||||
@ -69,8 +69,8 @@ describe('env function', function()
|
||||
|
||||
describe('os_getenv', function()
|
||||
itp('reads an env variable', function()
|
||||
local name = 'NEOVIM_UNIT_TEST_GETENV_1N'
|
||||
local value = 'NEOVIM_UNIT_TEST_GETENV_1V'
|
||||
local name = 'NVIM_UNIT_TEST_GETENV_1N'
|
||||
local value = 'NVIM_UNIT_TEST_GETENV_1V'
|
||||
eq(NULL, os_getenv(name))
|
||||
-- need to use os_setenv, because lua dosn't have a setenv function
|
||||
os_setenv(name, value, 1)
|
||||
@ -78,7 +78,7 @@ describe('env function', function()
|
||||
end)
|
||||
|
||||
itp('returns NULL if the env variable is not found', function()
|
||||
local name = 'NEOVIM_UNIT_TEST_GETENV_NOTFOUND'
|
||||
local name = 'NVIM_UNIT_TEST_GETENV_NOTFOUND'
|
||||
return eq(NULL, os_getenv(name))
|
||||
end)
|
||||
end)
|
||||
@ -97,8 +97,8 @@ describe('env function', function()
|
||||
|
||||
describe('os_getenvname_at_index', function()
|
||||
itp('returns names of environment variables', function()
|
||||
local test_name = 'NEOVIM_UNIT_TEST_GETENVNAME_AT_INDEX_1N'
|
||||
local test_value = 'NEOVIM_UNIT_TEST_GETENVNAME_AT_INDEX_1V'
|
||||
local test_name = 'NVIM_UNIT_TEST_GETENVNAME_AT_INDEX_1N'
|
||||
local test_value = 'NVIM_UNIT_TEST_GETENVNAME_AT_INDEX_1V'
|
||||
os_setenv(test_name, test_value, 1)
|
||||
local i = 0
|
||||
local names = { }
|
||||
@ -160,16 +160,16 @@ describe('env function', function()
|
||||
|
||||
describe('expand_env_esc', function()
|
||||
itp('expands environment variables', function()
|
||||
local name = 'NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN'
|
||||
local value = 'NEOVIM_UNIT_TEST_EXPAND_ENV_ESCV'
|
||||
local name = 'NVIM_UNIT_TEST_EXPAND_ENV_ESCN'
|
||||
local value = 'NVIM_UNIT_TEST_EXPAND_ENV_ESCV'
|
||||
os_setenv(name, value, 1)
|
||||
-- TODO(bobtwinkles) This only tests Unix expansions. There should be a
|
||||
-- test for Windows as well
|
||||
local input1 = to_cstr('$NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN/test')
|
||||
local input2 = to_cstr('${NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN}/test')
|
||||
local input1 = to_cstr('$NVIM_UNIT_TEST_EXPAND_ENV_ESCN/test')
|
||||
local input2 = to_cstr('${NVIM_UNIT_TEST_EXPAND_ENV_ESCN}/test')
|
||||
local output_buff1 = cstr(255, '')
|
||||
local output_buff2 = cstr(255, '')
|
||||
local output_expected = 'NEOVIM_UNIT_TEST_EXPAND_ENV_ESCV/test'
|
||||
local output_expected = 'NVIM_UNIT_TEST_EXPAND_ENV_ESCV/test'
|
||||
cimp.expand_env_esc(input1, output_buff1, 255, false, true, NULL)
|
||||
cimp.expand_env_esc(input2, output_buff2, 255, false, true, NULL)
|
||||
eq(output_expected, ffi.string(output_buff1))
|
||||
|
2
third-party/CMakeLists.txt
vendored
2
third-party/CMakeLists.txt
vendored
@ -1,6 +1,6 @@
|
||||
# This is not meant to be included by the top-level.
|
||||
cmake_minimum_required (VERSION 2.8.7)
|
||||
project(NEOVIM_DEPS)
|
||||
project(NVIM_DEPS)
|
||||
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
Loading…
Reference in New Issue
Block a user