cmake fails with CMAKE_CXX_FLAGS="-Wall -Werror" - Redmine #2073
Using -Wall together with -Werror makes cmake fail:
cmake -DCMAKE_CXX_FLAGS="-Wall -Werror" ..
...
-- Performing Test CXX11_SUPPORTED - Failed
CMake Error at cmake/gmxTestCXX11.cmake:113 (message):
This version of GROMACS requires a C++11 compiler. Please use a newer
compiler or use the GROMACS 5.1.x release. See the installation guide for
details.
Call Stack (most recent call first):
CMakeLists.txt:164 (gmx_test_cxx11)
-- Configuring incomplete, errors occurred!
due to
build/CMakeFiles/CMakeTmp/src.cxx:45:11: error: unused variable ‘x’ [-Werror=unused-variable]
double *x = nullptr;
^
cc1plus: all warnings being treated as errors
(from redmine: issue id 2073, created on 2016-11-13 by junghans, closed on 2017-01-20)
- Changesets:
- Revision 31f0c056 by Aleksei Iupinov on 2017-01-05T14:33:29Z:
Fix compilation with CMAKE_CXX_FLAGS="-Wall -Werror"
Refs #2073
Change-Id: I9223b13e8abd251d56378052ace4fb4e9169a2aa