windowsvisual-studiovisual-c++nmakecl.exe

MSVC - do not display compiler version/copyright information


I have a makefile:

all: hello.cpp
    cl /EHsc hello.cpp

In developer powershell when I type nmake I get:


Microsoft (R) Program Maintenance Utility Version 14.28.29915.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl /EHsc hello.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29915 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

hello.cpp
Microsoft (R) Incremental Linker Version 14.28.29915.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello.exe
hello.obj

Is there a way to not display

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29915 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

and

Microsoft (R) Incremental Linker Version 14.28.29915.0
Copyright (C) Microsoft Corporation.  All rights reserved.

but just display

Microsoft (R) Program Maintenance Utility Version 14.28.29915.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl /EHsc hello.cpp

hello.cpp
/out:hello.exe
hello.obj

or something similar. I just want the microsoft banners to not be displayed as they take up unnecessary lines.


Solution

  • As suggested by @dxiv in the comments, adding /nologo flag seems to have worked. The modified makefile is:

    all: hello.cpp
        cl /EHsc /nologo hello.cpp
    
    

    The output on the developer powershell is:

    Microsoft (R) Program Maintenance Utility Version 14.28.29915.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
            cl /EHsc /nologo hello.cpp
    hello.cpp
    

    I don't know why does microsoft feel the need to display this (compiler version and copyright information) information by default as it is completely unnecessary. If I need the compiler version for debugging I should be able to do something like cl -v similar to g++ for UNIX. More flags can be found here.