VC++ compile options

A

ashu

Hi all,
My question is about the syntax of the VC++project file. I have a set
of files which make up the build and I wanted to apply O2 level
optimization only on one file.
Below is a snippet of the .vcxproj file.
****************************************************************
<ItemGroup>
<ClCompile Include="..\src\b_wrapper.c" />
<ClCompile Include="..\src\assh.c" />
<ClCompile Include="..\src\user_line.c" >
<Optimization>/O2</Optimization>
</ClCompile>
</ItemGroup>
******************************************************************
Is the syntax is correct and in that case, would it lead to O2 level
optimization only on user_line.c file ?

regards
ashu
 
G

Geoff

Hi all,
My question is about the syntax of the VC++project file. I have a set
of files which make up the build and I wanted to apply O2 level
optimization only on one file.
Below is a snippet of the .vcxproj file.
****************************************************************
<ItemGroup>
<ClCompile Include="..\src\b_wrapper.c" />
<ClCompile Include="..\src\assh.c" />
<ClCompile Include="..\src\user_line.c" >
<Optimization>/O2</Optimization>
</ClCompile>
</ItemGroup>
******************************************************************
Is the syntax is correct and in that case, would it lead to O2 level
optimization only on user_line.c file ?

regards
ashu

This is off-topic for this group.

However, why are you poking at the project file manually? VC++ IDE
allows you to set per-file optimization settings. Use the Project
Explorer and right-click the source file, then edit properties for
that file.

NOTE: VC++ turns off optimizations in Debug build and sets -O2 on
Release builds across the entire project by default.
 
M

Malcolm McLean

Is the syntax is correct and in that case, would it lead to O2 level
optimization only on user_line.c file ?
Unlikely. It's not well-formed xml as the structure would suggest what
you suppose, but most compilers will compile several C source files on
one invocation, keeping the same settings. However the only real way
to find out is to ask VC++ technical support, and even they will
probably have to root around for the answer. Or you could set up a
test file if the optimiser defines a symbol to the preprocessor.
 
G

Geoff

Hi all,
My question is about the syntax of the VC++project file. I have a set
of files which make up the build and I wanted to apply O2 level
optimization only on one file.
Below is a snippet of the .vcxproj file.
****************************************************************
<ItemGroup>
<ClCompile Include="..\src\b_wrapper.c" />
<ClCompile Include="..\src\assh.c" />
<ClCompile Include="..\src\user_line.c" >
<Optimization>/O2</Optimization>
</ClCompile>
</ItemGroup>
******************************************************************
Is the syntax is correct and in that case, would it lead to O2 level
optimization only on user_line.c file ?

regards
ashu

I selected a single source file within a project with Project Explorer
and it did this:

<ClCompile Include="g_misc.c">
<PreprocessorDefinitions
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MaxSpeed</Optimization>
</ClCompile>
 
M

Man-wai Chang

My question is about the syntax of the VC++project file. I have a set
of files which make up the build and I wanted to apply O2 level
optimization only on one file.
Below is a snippet of the .vcxproj file.

Shouldn't you use a make file if you wanna do things command-line?

--
@~@ You have the right to remain silence.
/ v \ Simplicity is Beauty! May the Force and farces be with you!
/( _ )\ (Fedora 15 i686) Linux 3.2.6
^ ^ 15:41:01 up 9 days 2:38 0 users load average: 0.00 0.01 0.05
ä¸å€Ÿè²¸! ä¸è©é¨™! ä¸æ´äº¤! ä¸æ‰“交! ä¸æ‰“劫! ä¸è‡ªæ®º! è«‹è€ƒæ…®ç¶œæ´ (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top