Introduce nvim namespace: Fix build process.

- Leave src as include dir (for includes to recognize 'nvim/' prefix).
- Change subdirectory from src to src/nvim.
- Fix msgpack generation.
- Fix some other paths to new locations.
This commit is contained in:
Eliseo Martínez 2014-05-12 15:50:37 +02:00
parent da51dc9cf2
commit a6734844ca
5 changed files with 9 additions and 9 deletions

View File

@ -111,7 +111,7 @@ if(${LUA_MSGPACK_MISSING})
endif()
add_subdirectory(config)
add_subdirectory(src)
add_subdirectory(src/nvim)
add_subdirectory(test/includes)
find_program(BUSTED_PRG busted)
@ -168,5 +168,5 @@ endif()
# well with the legacy tests. I have a branch that converts them to run under
# CTest, but it needs a little more work.
# add_custom_target(test
# COMMAND ${MAKE_PRG} -C ${CMAKE_CURRENT_SOURCE_DIR}/src/testdir
# COMMAND ${MAKE_PRG} -C ${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/testdir
# VIMPROG=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/nvim)

View File

@ -60,14 +60,14 @@ deps: | .deps/build/third-party/.ran-cmake
touch $@
test: | nvim
+$(SINGLE_MAKE) -C src/testdir
+$(SINGLE_MAKE) -C src/nvim/testdir
unittest: | nvim
+$(BUILD_CMD) -C build unittest
clean:
+test -d build && $(BUILD_CMD) -C build clean || true
$(MAKE) -C src/testdir clean
$(MAKE) -C src/nvim/testdir clean
distclean: clean
rm -rf .deps build

View File

@ -1,4 +1,4 @@
#include "${PROJECT_SOURCE_DIR}/src/vim.h"
#include "${PROJECT_SOURCE_DIR}/src/nvim/vim.h"
char_u *default_vim_dir = (char_u *)"${CMAKE_INSTALL_PREFIX}/share/vim";
char_u *default_vimruntime_dir = (char_u *)"";
char_u *all_cflags = (char_u *)"${COMPILER_FLAGS}";

View File

@ -95,11 +95,11 @@ output:write([[
#include <stdint.h>
#include <msgpack.h>
#include "os/msgpack_rpc.h"
#include "nvim/os/msgpack_rpc.h"
]])
for i = 1, #headers do
output:write('\n#include "'..headers[i]..'"')
output:write('\n#include "nvim/'..headers[i]..'"')
end
output:write([[

View File

@ -1,9 +1,9 @@
include(CheckLibraryExists)
set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/auto)
set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/nvim/auto)
set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua)
file(GLOB API_HEADERS api/*.h)
set(MSGPACK_RPC_HEADER ${PROJECT_SOURCE_DIR}/src/os/msgpack_rpc.h)
set(MSGPACK_RPC_HEADER ${PROJECT_SOURCE_DIR}/src/nvim/os/msgpack_rpc.h)
set(MSGPACK_DISPATCH ${GENERATED_DIR}/msgpack_dispatch.c)
# Remove helpers.h from API_HEADERS since it doesn't contain public API