View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015866CMakeCMakepublic2015-11-28 15:152016-06-10 14:31
Reportertemp4746 
Assigned ToKitware Robot 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionmoved 
PlatformWindowsOSOS Version
Product VersionCMake 3.4 
Target VersionFixed in Version 
Summary0015866: CMake should work around D9025 when using NMake Makefiles generator
DescriptionWhen 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 Reproducecmake_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.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0042894)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-11-28 15:15 temp4746 New Issue
2016-06-10 14:29 Kitware Robot Note Added: 0042894
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team