| 1 | <?xml version="1.0" ?> |
|---|
| 2 | <!-- $Id: simple.bkl,v 1.2 2004/04/30 21:55:10 vaclavslavik Exp $ --> |
|---|
| 3 | |
|---|
| 4 | <!-- |
|---|
| 5 | |
|---|
| 6 | Adds the logic for handling a UNICODE=0/1 option, which switches between unicode and |
|---|
| 7 | ansi builds. |
|---|
| 8 | |
|---|
| 9 | Usage: use template "unicodeopt" for your targets: |
|---|
| 10 | |
|---|
| 11 | <include file="presets/unicodeopt.bkl"/> |
|---|
| 12 | |
|---|
| 13 | <exe id="myapp" template="unicodeopt"> |
|---|
| 14 | <sources>myapp.cpp</sources> |
|---|
| 15 | </exe> |
|---|
| 16 | |
|---|
| 17 | --> |
|---|
| 18 | |
|---|
| 19 | <makefile> |
|---|
| 20 | |
|---|
| 21 | <set var="UNICODE_DEFAULT" overwrite="0">0</set> |
|---|
| 22 | <option name="UNICODE"> |
|---|
| 23 | <values>0,1</values> |
|---|
| 24 | <default-value>$(UNICODE_DEFAULT)</default-value> |
|---|
| 25 | <values-description>ANSI,Unicode</values-description> |
|---|
| 26 | <description>Set to 1 to build Unicode version</description> |
|---|
| 27 | </option> |
|---|
| 28 | |
|---|
| 29 | <template id="unicodeopt"> |
|---|
| 30 | <define> |
|---|
| 31 | $(substituteFromDict(UNICODE,{'1':'_UNICODE','0':''})) |
|---|
| 32 | </define> |
|---|
| 33 | </template> |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | <!-- The UNICODEBUILDPOSTFIX variable is useful to set the BUILDDIR variable |
|---|
| 37 | as done in presets/setbuilddir.bkl --> |
|---|
| 38 | <set var="UNICODEBUILDPOSTFIX"> |
|---|
| 39 | <if cond="UNICODE=='0'">a</if> |
|---|
| 40 | <if cond="UNICODE=='1'">u</if> |
|---|
| 41 | </set> |
|---|
| 42 | |
|---|
| 43 | </makefile> |
|---|