Home » Community » Newbie corner » Per file compile flags
Per file compile flags [message #39132] |
Mon, 18 February 2013 03:48 |
rxantos
Messages: 72 Registered: October 2011
|
Member |
|
|
How do I add a different compile flag to just one file inside a project?
I'm using MSVC.
Specifically I want to be able to use pre-compiled headers and it requires one file to have the flags to create the pre-compiled headers, while the rest have the flags to just use the pre-compiled headers.
|
|
|
Re: Per file compile flags [message #39133 is a reply to message #39132] |
Mon, 18 February 2013 07:28 |
|
rxantos wrote on Mon, 18 February 2013 03:48 | How do I add a different compile flag to just one file inside a project?
I'm using MSVC.
Specifically I want to be able to use pre-compiled headers and it requires one file to have the flags to create the pre-compiled headers, while the rest have the flags to just use the pre-compiled headers.
|
Hi,
The precompiled headers are AFAIK not supported in TheIDE. You can in theory use a custom build step for this. Just create a dummy file, with some distinct extension (anything goes, eg. cppforheaders ) and make it include the headers to be precompiled. Then you can set the the 'cl.exe -Yc"header.pch" ... ' command as a custom build step (see this page for details) for files with your special extension (you can do this in Poject -> Custom build steps). The other files can then get the -Yu parameter by adding it as an additional compiler option to your package in Package manager.
Disclaimer: I never used precompiled headers nor MSVC, so I might be partially all completely wrong
Best regards,
Honza
|
|
|
|
Goto Forum:
Current Time: Fri Apr 26 07:42:09 CEST 2024
Total time taken to generate the page: 0.03117 seconds
|