refactor(build): make all generated c files headers

There's no "rule" or bad practice or whatever that says we cannot
generate c files. it is is just that we have ~20 generated headers
and ~2 generated sources and there is nothing in these two generated
source files which sets them aparts. Lua bindings are not different from
rpc bindings, and pathdef is not different from versiondef.

So to simplify build logic and ease the future port to build.zig,
streamline the build to only have generated headers, no direct generated
.c files.

Also "nlua_add_api_functions" had its prototype duplicated twice which
defeated the point of having mandatory prototypes (one source of truth).
This commit is contained in:
bfredl
2024-04-27 09:21:46 +02:00
parent 435dee74bb
commit 3711a0387a
7 changed files with 24 additions and 35 deletions

View File

@ -194,6 +194,6 @@ file(GENERATE
INPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h.gen")
configure_file (
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c"
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.h"
ESCAPE_QUOTES)

View File

@ -1,4 +1,3 @@
#include "${PROJECT_SOURCE_DIR}/src/nvim/vim_defs.h"
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
char *default_vimruntime_dir = "";
char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim";