diff options
author | James McCoy <jamessan@jamessan.com> | 2018-06-15 00:00:08 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2018-06-18 07:58:18 -0400 |
commit | 4938ee08e8e64496e9d01e6326e77cb394f3a00f (patch) | |
tree | 43008cf4d68a0be5fb2a1c184bf925f1d4254124 | |
parent | 66a39fce6c70222a7f4a2dbd223a6d0c3a4a5789 (diff) | |
download | rneovim-4938ee08e8e64496e9d01e6326e77cb394f3a00f.tar.gz rneovim-4938ee08e8e64496e9d01e6326e77cb394f3a00f.tar.bz2 rneovim-4938ee08e8e64496e9d01e6326e77cb394f3a00f.zip |
cmake: Check for GNU compiler, not Linux, to set -D_GNU_SOURCE
The Debian hurd-i386 [build] failed (partly) due to -D_GNU_SOURCE not be
defined:
[215/286] /usr/bin/cc -DINCLUDE_GENERATED_DECLARATIONS -Iconfig -I../src -Isrc/nvim/auto -Iinclude -I/usr/include/luajit-2.1 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=2 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -MD -MT src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o -MF src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o.d -o src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o -c ../src/nvim/os/pty_process_unix.c
../src/nvim/os/pty_process_unix.c: In function 'pty_process_tty_name':
../src/nvim/os/pty_process_unix.c:121:10: warning: implicit declaration of function 'ptsname'; did you mean 'ttyname'? [-Wimplicit-function-declaration]
return ptsname(ptyproc->tty_fd);
Hurd is obviously not Linux, but it is using a GNU compiler and glibc so
it needs -D_GNU_SOURCE for the ptsname() definition to be visible.
[build]: https://buildd.debian.org/status/fetch.php?pkg=neovim&arch=hurd-i386&ver=0.3.0-2&stamp=1528981349&raw=0
-rw-r--r-- | CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2100c53ad2..65490e4b6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -297,7 +297,7 @@ option(LOG_LIST_ACTIONS "Add list actions logging" OFF) add_definitions(-DINCLUDE_GENERATED_DECLARATIONS) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined") |