diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-10-02 15:26:16 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-10-02 15:26:16 -0400 |
commit | f454e4bb11a7a69f1c03325016e3b95cda2fc08e (patch) | |
tree | 21af466cad12a339532a23c5c5c50999d56beaa1 | |
parent | 536c0ba27e79929eb30850d8e11f2ed026930ab3 (diff) | |
parent | e0974bdd0d7c9b2f8467bf4c7d9098ff9268eb5b (diff) | |
download | rneovim-f454e4bb11a7a69f1c03325016e3b95cda2fc08e.tar.gz rneovim-f454e4bb11a7a69f1c03325016e3b95cda2fc08e.tar.bz2 rneovim-f454e4bb11a7a69f1c03325016e3b95cda2fc08e.zip |
Merge pull request #3414 from Pyrohh/cmake-check-wvla
build: Check for -Wvla before use
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 28ec20822f..348e138a06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,7 +142,7 @@ if(MSVC) add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) else() add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter - -Wstrict-prototypes -Wvla -std=gnu99) + -Wstrict-prototypes -std=gnu99) endif() if(MINGW) @@ -150,9 +150,14 @@ if(MINGW) add_definitions(-D__USE_MINGW_ANSI_STDIO) endif() +# OpenBSD's GCC (4.2.1) doesn't have -Wvla +check_c_compiler_flag(-Wvla HAS_WVLA_FLAG) +if(HAS_WVLA_FLAG) + add_definitions(-Wvla) +endif() + check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG) check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG) - if(HAS_FSTACK_PROTECTOR_STRONG_FLAG) add_definitions(-fstack-protector-strong) elseif(HAS_FSTACK_PROTECTOR_FLAG) |