Junior Programmer
Junior Programmer

Reputation: 420

Visual Studio 2012 C++ How to add compiler option in NMake project

I am currently modifying on a open-source project to suit my own need, however, the project to be built (or compiler) requires me to add a /EHsc option to cl.exe

I am using Microsoft Visual Studio 2012 to work on the project. I have been searching long enough but I cannot find the solution still.

Is it possible to add a flag via MS Visual Studio 2012? Because I saw the output log displaying that compiler (cl.exe) compiled with various flag in this project such as /nologo /c /WX.

How can I add the options to cl.exe with this IDE?

Project working on : SumatraPDF

[Edit #1] After reading the first answer provided below, this is the screen I got, it doesn't seem there is an option to do so. Conf

Upvotes: 2

Views: 6300

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262939

Update: From the screenshot you posted, it seems the SumatraPDF project is NMake-based.

Therefore, you will have to add /EHsc to the build command line, using the NMake property page described here, or edit the Makefile directly.

Original, misguided answer follows:

Per MSDN:

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Select the C/C++ folder.

  3. Select the Code Generation property page.

  4. Modify the Enable C++ Exceptions property.

Or, set Enable C++ Exceptions to No, and then on the Command Line property page, in the Additional Options box, add the compiler option.

Upvotes: 2

Related Questions