Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/doc/html/bbv2/faq/s07.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 3.5 KB
Line 
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>How to change compilation flags for one file?
5    </title>
6<link rel="stylesheet" href="../../boostbook.css" type="text/css">
7<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
8<style type="text/css">
9body { background-image: url('http://docbook.sourceforge.net/release/images/draft.png');
10       background-repeat: no-repeat;
11       background-position: top left;
12       /* The following properties make the watermark "fixed" on the page. */
13       /* I think that's just a bit too distracting for the reader... */
14       /* background-attachment: fixed; */
15       /* background-position: center center; */
16     }</style>
17<link rel="start" href="../../index.html" title="The Boost C++ Libraries">
18<link rel="up" href="../faq.html" title="Chapter 27. Frequently Asked Questions">
19<link rel="prev" href="s06.html" title="How to get the project-root location?
20    ">
21<link rel="next" href="dll-path.html" title="Why are the dll-path and
22    hardcode-dll-paths properties useful?
23    ">
24</head>
25<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
26<table cellpadding="2" width="100%">
27<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../boost.png"></td>
28<td align="center"><a href="../../../../index.htm">Home</a></td>
29<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
30<td align="center"><a href="../../../../people/people.htm">People</a></td>
31<td align="center"><a href="../../../../more/faq.htm">FAQ</a></td>
32<td align="center"><a href="../../../../more/index.htm">More</a></td>
33</table>
34<hr>
35<div class="spirit-nav">
36<a accesskey="p" href="s06.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="dll-path.html"><img src="../../images/next.png" alt="Next"></a>
37</div>
38<div class="section" lang="en">
39<div class="titlepage"><div><div><h2 class="title" style="clear: both">
40<a name="id2861867"></a>How to change compilation flags for one file?
41    </h2></div></div></div>
42<p>If one file must be compiled with special options, you need to
43      explicitly declare an <code class="computeroutput">obj</code> target for that file and then use
44      that target in your <code class="computeroutput">exe</code> or <code class="computeroutput">lib</code> target:
45</p>
46<pre class="programlisting">
47exe a : a.cpp b ;
48obj b : b.cpp : &lt;optimization&gt;off ;
49</pre>
50<p>
51      Of course you can use other properties, for example to specify specific
52      compiler options:
53</p>
54<pre class="programlisting">
55exe a : a.cpp b ;
56obj b : b.cpp : &lt;cflags&gt;-g ;
57</pre>
58<p>
59      You can also use <a href="../tutorial/conditions.html" title="Conditions and alternatives">conditional
60      properties</a> for finer control:
61</p>
62<pre class="programlisting">
63exe a : a.cpp b ;
64obj b : b.cpp : &lt;variant&gt;release:&lt;optimization&gt;off ;
65</pre>
66</div>
67<table width="100%"><tr>
68<td align="left"></td>
69<td align="right"><small></small></td>
70</tr></table>
71<hr>
72<div class="spirit-nav">
73<a accesskey="p" href="s06.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="dll-path.html"><img src="../../images/next.png" alt="Next"></a>
74</div>
75</body>
76</html>
Note: See TracBrowser for help on using the repository browser.