On 03/31/2016 12:47 PM, Ruslan Baratov wrote:
> What about 3 properties containing list of <warning-id>'s (groups 
> unexpanded):
> 
> * COMPILE_WARNINGS_DISABLE # e.g. "shift-sign-overflow;unused"
> * COMPILE_WARNINGS_ENABLE # e.g. "ALL"
> * COMPILE_WARNINGS_TREAT_AS_ERROR # e.g. group + specific: "inline;undef"

We would need to define behavior when a warning appears in more than
one list.  Perhaps we need to define some kind of `=on/off/error/no-error`
syntax for each list entry.

The name "ALL" may not be representative.  Even -Wall does not really enable
all possible warnings on some compilers.  I'd like to find another name that
captures the idea of enabling most warnings.  Or we could try to subsume it
into an interface for the warning level, with -Wall considered "high".

> I'm not sure about mixing more languages. I think it will be similar to 
> COMPILE_OPTIONS (?), see no language specification in 
> `add_compile_options` command.

Right.  We do have the COMPILE_LANGUAGE genex for some limited use cases.
Its documentation even includes a COMPILE_OPTIONS example.  However, it
also documents that it is not possible to implement fully on VS IDE
generators.  For example, VS does not distinguish between C and C++
flags.  The same set is always used for both.

Another option is to have the warning names themselves have a language
in them, similar to the COMPILE_FEATURES names.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to