Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Per file compile flags
Per file compile flags [message #39132] Mon, 18 February 2013 03:48 Go to next message
rxantos is currently offline  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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Smile ) 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 Wink

Best regards,
Honza
Re: Per file compile flags [message #39134 is a reply to message #39133] Mon, 18 February 2013 07:40 Go to previous message
rxantos is currently offline  rxantos
Messages: 72
Registered: October 2011
Member
Thank you
Previous Topic: Is there any trick to reduce the executable even further?
Next Topic: How to create a U++ based DLL?
Goto Forum:
  


Current Time: Fri Apr 26 07:42:09 CEST 2024

Total time taken to generate the page: 0.03117 seconds