The following issue has been SUBMITTED. ====================================================================== https://public.kitware.com/Bug/view.php?id=15866 ====================================================================== Reported By: temp4746 Assigned To: ====================================================================== Project: CMake Issue ID: 15866 Category: CMake Reproducibility: always Severity: feature Priority: normal Status: new ====================================================================== Date Submitted: 2015-11-28 15:15 EST Last Modified: 2015-11-28 15:15 EST ====================================================================== Summary: CMake should work around D9025 when using NMake Makefiles generator Description: When using the Visual Studio IDE generators CMake maps compiler/linker flags supported by the IDE to the vcxproj properties. This as a side effect prevents passing multiple conflicting flags for most commonly used compiler/linker flags, such as "/W[0-4]".
This is not done for NMake Makefiles, this means when you use them and additionally use something like: target_compile_options(target PRIVATE /W0) You will receive D9025 warnings. This warning is because the cl compiler is annoying and unlike gcc/clang will emit a warning (D9025) when there are conflicting flags and still use the later flag in the command line like expected. I think CMake should work around this by removing conflicting flags leaving only the latest one on the command line, similar to what you get when you use the IDE project files. At least for the commonly used flags or ones that exist in the IDE project files as specific properties. Steps to Reproduce: cmake_minimum_required(VERSION 3.4) project(flags) add_library(a STATIC a.cpp) target_compile_options(a PRIVATE /W4) Try this both with an MSVC IDE and NMake Makefiles. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-11-28 15:15 temp4746 New Issue ====================================================================== -- 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