| 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 SHARED=0/1 option, which switches between static and |
|---|
| 7 | shared (DLL) builds. |
|---|
| 8 | |
|---|
| 9 | Usage: use template "sharedopt" for your targets: |
|---|
| 10 | |
|---|
| 11 | <include file="presets/sharedopt.bkl"/> |
|---|
| 12 | |
|---|
| 13 | <lib id="mylib_static" cond="SHARED=='0'"> |
|---|
| 14 | <sources>mylib.cpp</sources> |
|---|
| 15 | </lib> |
|---|
| 16 | |
|---|
| 17 | <dll id="mylib_shared" cond="SHARED=='1'"> |
|---|
| 18 | <sources>mylib.cpp</sources> |
|---|
| 19 | </dll> |
|---|
| 20 | |
|---|
| 21 | <set var="MSVC6PRJ_MERGED_TARGETS">mylib=mylib_static+mylib_shared</set> |
|---|
| 22 | --> |
|---|
| 23 | |
|---|
| 24 | <makefile> |
|---|
| 25 | |
|---|
| 26 | <set var="SHARED_DEFAULT" overwrite="0">0</set> |
|---|
| 27 | <option name="SHARED"> |
|---|
| 28 | <values>0,1</values> |
|---|
| 29 | <default-value>$(SHARED_DEFAULT)</default-value> |
|---|
| 30 | <values-description>Static,DLL</values-description> |
|---|
| 31 | <description>Set to 1 to build shared (DLL) version</description> |
|---|
| 32 | </option> |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | <!-- The SHAREDBUILDPOSTFIX variable is useful to set the BUILDDIR variable |
|---|
| 36 | as done in presets/setbuilddir.bkl --> |
|---|
| 37 | <set var="SHAREDBUILDPOSTFIX"> |
|---|
| 38 | <if cond="SHARED=='0'">static</if> |
|---|
| 39 | <if cond="SHARED=='1'">shared</if> |
|---|
| 40 | </set> |
|---|
| 41 | |
|---|
| 42 | </makefile> |
|---|