<default-value>`$(DOLLAR)(WX_CONFIG) --cppflags`</default-value>
<description>C preprocessor flags to use with wxWidgets code</description>
</option>
- <option name="WX_LIBS">
- <default-value>`$(DOLLAR)(WX_CONFIG) --libs`</default-value>
- <description>wxWidgets libraries to link against</description>
- </option>
<option name="WX_RESCOMP">
<default-value>`$(DOLLAR)(WX_CONFIG) --rescomp`</default-value>
<description>wxWidgets resource compiler and flags</description>
</if>
<!--
- We need to re-define the resource compiler, used by bakefile when compiling
- resources, to the resource compiler returned by 'wx-config --rescomp' since
- 'wx-config --rescomp' returns both the name of the resource compiler to use
- and the flags required for that compiler (rcflags are rccompiler-specific
- and thus it would be wrong to use them with other resource compilers).
+ We need to re-define the WINDRES resource compiler name to the resource compiler
+ returned by 'wx-config - -rescomp' since this option returns both the name of the
+ resource compiler to use (windres) and the flags required for that compiler.
This line typically does something *only* when the Makefile.in generated
using this bakefile, is used on Windows with MSYS (when using Cygwin, resources
are not compiled at all).
-
- NOTE: overwriting the RESCOMP variable we modify the entire Bakefile behaviour
- for resource compilation; this could be a problem if the bakefile which
- includes this file needs the standard Bakefile resource compiler to
- build a non wx-based application.
+ Without this line, in fact, when compiling with MSYS on Windows, the - -include-dir
+ option which tells windres to look in wxWidgets\include folder would be missing and
+ then windres would fail to find the wxMSW resources.
+
+ NOTE: overwriting the WINDRES variable we add wxWidgets resource flags to
+ all targets which include this bakefile; this could be useless to those
+ targets which are not wx-based eventually present in that bakefile but
+ in any case it shouldn't do any harm.
-->
- <set var="RESCOMP">$(WX_RESCOMP)</set>
+ <set var="WINDRES">$(WX_RESCOMP)</set>
<template id="wx-lib">
<cxxflags>$(WX_CXXFLAGS)</cxxflags>
-->
</template>
- <!-- not used together with wx-config: -->
+ <!-- VERY IMPORTANT: <wx-lib>base</wx-lib> must be the last wx-lib tag
+ in all your bakefiles !!
+ -->
<define-tag name="wx-lib" rules="exe,dll,module">
- <if cond="value=='base'">
+ <if cond="FORMAT=='autoconf' and value=='base'">
+ <!-- all wx-dependent libraries should have been already listed
+ thus we can now add WX_LIBS to the linker line -->
<ldlibs>$(WX_LIBS)</ldlibs>
</if>
+ <if cond="FORMAT=='gnu' and value=='base'">
+ <!-- all wx libraries should have been already specified, thus
+ $(__liblist) should contain the full list... -->
+ <set var="__liblist" append="1">base</set>
+ <ldlibs>`$(WX_CONFIG) --libs $(','.join(__liblist.split()))`</ldlibs>
+ </if>
+ <if cond="FORMAT=='gnu' and value!='base'">
+ <set var="__liblist" append="1">$(value)</set>
+ </if>
+ <if cond="value not in ALLLIB_LIST.split()">
+ <error>Unknown wxWidgets library given in the wx-lib tag</error>
+ </if>
</define-tag>
</makefile>