diff options
author | John Szakmeister <john@szakmeister.net> | 2014-06-25 06:33:36 -0400 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2014-06-27 06:58:46 -0400 |
commit | 3b3811b16537c302f2218069dfce9611e15e3bd5 (patch) | |
tree | 49faea9322092fae26cf3df127be16a0b3c214f9 | |
parent | b083c0346234bf5c564a3036d568607fc66da045 (diff) | |
download | rneovim-3b3811b16537c302f2218069dfce9611e15e3bd5.tar.gz rneovim-3b3811b16537c302f2218069dfce9611e15e3bd5.tar.bz2 rneovim-3b3811b16537c302f2218069dfce9611e15e3bd5.zip |
Fix #867: cmake doesn't issue `-isystem` for versioned gcc
CMake purposefully disables the use of the `-isystem` flag on Apple
platforms, but it's overly blunt with the detection. Apple's compilers
have supported the flag since at least 10.4. Let's force the switch to
be on when gcc/g++ is detected on an Apple platform to reduce the
warnings out of the msgpack-related bits.
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3235d0e942..6ad0af4cea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,17 @@ set(NEOVIM_VERSION_PATCH 0) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +# Work around some old, broken detection by CMake for knowing when to use the +# isystem flag. Apple's compilers have supported this for quite some time now. +if(APPLE) + if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") + endif() + if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") + endif() +endif() + add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter -std=gnu99) option( |