In the following section of the main CMakeLists.txt file,
# Allow builds to complete with warnings (do not set -Werror)
option(CIVETWEB_ALLOW_WARNINGS "Do not stop build if there are warnings" OFF)
message(STATUS "Build if there are warnings - ${CIVETWEB_ALLOW_WARNINGS}")
when I switch CIVETWEB_ALLOW_WARNINGS
to ON
, I still get the message
-- Build if there are warnings - OFF
even if I use "reload the cmake project" in clion.
Using cmake from the command line, the output is correctly
-- Build if there are warnings - ON
What do I have to do in clion such that cmake changes are refreshed correctly?
UPDATE 1:
I changed in clion's cmake cache CIVETWEB_ALLOW_WARNINGS
to ON
, but I still get
error: macro name is a reserved identifier [-Werror,-Wreserved-id-macro]
#define _GNU_SOURCE /* for setgroups() */
UPDATE 2:
The following lines from CMakeLists.txt are also relevant for -Werror
:
if (NOT CIVETWEB_ALLOW_WARNINGS)
add_c_compiler_flag(-Werror)
endif()
and
if (NOT CIVETWEB_ALLOW_WARNINGS)
add_cxx_compiler_flag(-Werror)
endif()
However, note that ${CIVETWEB_ALLOW_WARNINGS}
in the message above is already evaluated to OFF
in clion and to ON
on the command line.