diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-06-26 18:17:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-26 03:17:57 -0700 |
commit | 3d45706478cd030c3ee05b4f336164bb96138095 (patch) | |
tree | 23fb805904e87cb57cb2ee6000ddb6ffde0c4f8d /test/functional/api/vim_spec.lua | |
parent | 7dd73625dccc8abddf892b54017b655cdafa1183 (diff) | |
download | rneovim-3d45706478cd030c3ee05b4f336164bb96138095.tar.gz rneovim-3d45706478cd030c3ee05b4f336164bb96138095.tar.bz2 rneovim-3d45706478cd030c3ee05b4f336164bb96138095.zip |
build: guard free_locales with HAVE_WORKING_LIBINTL #19095
With 4c7462fdb313a64d6903809ece2d8d564c0ea420, when `libintl` is turned off via
`-DENABLE_LIBINTL=OFF`, Neovim does not compile in Debug mode with the following
error message:
```
...
[201/331] Building C object src/nvim/CMakeFiles/nvim.dir/eval.c.o
FAILED: src/nvim/CMakeFiles/nvim.dir/eval.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DEXITFREE -DINCLUDE_GENERATED_DECLARATIONS -DMIN_LOG_LEVEL=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -Dnvim_EXPORTS -I/Users/hat/Projects/neovim/build/config -I/Users/hat/Projects/neovim/src -I/Users/hat/Projects/neovim/build/src/nvim/auto -I/Users/hat/Projects/neovim/build/include -I/Users/hat/Projects/neovim/.deps/usr/include/luajit-2.1 -isystem /Users/hat/Projects/neovim/.deps/usr/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -g -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -Wno-conversion -MD -MT src/nvim/CMakeFiles/nvim.dir/eval.c.o -MF src/nvim/CMakeFiles/nvim.dir/eval.c.o.d -o src/nvim/CMakeFiles/nvim.dir/eval.c.o -c /Users/hat/Projects/neovim/src/nvim/eval.c
/Users/hat/Projects/neovim/src/nvim/eval.c:473:3: error: implicit declaration of function 'free_locales' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
free_locales();
^
/Users/hat/Projects/neovim/src/nvim/eval.c:473:3: note: did you mean 'free_titles'?
/Users/hat/Projects/neovim/build/include/buffer.h.generated.h:58:16: note: 'free_titles' declared here
DLLEXPORT void free_titles(void);
^
1 error generated.
[212/331] Building C object src/nvim/CMakeFiles/nvim.dir/eval/funcs.c.o
ninja: build stopped: subcommand failed.
make: *** [nvim] Error 1
```
The previous commit, b1b58020094a2ffa85e40194b8beb2945396610a, to 4c7462f does
not have this issue. As you can see in the following, the issue occurs only in
Debug mode with `libintl` turned off:
```bash
# No issue
git checkout b1b5802
# The following Debug build works
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
# The following Release build works
make distclean; make CMAKE_BUILD_TYPE=Release SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
# Compile error when in Debug and libintl turned off
git checkout 4c7462f
# The following Debug build does not work
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
# The following Debug build works
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
# The following Release build works
make distclean; make CMAKE_BUILD_TYPE=Release SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
```
I noticed this because I turn `libintl` off when compiling `libnvim` for VimR.
Fix #19093
Diffstat (limited to 'test/functional/api/vim_spec.lua')
0 files changed, 0 insertions, 0 deletions