]> git.saurik.com Git - wxWidgets.git/blame - build/bakefiles/common.bkl
Make mouse capture checking asserts stronger and more detailed.
[wxWidgets.git] / build / bakefiles / common.bkl
CommitLineData
ddf98968 1<?xml version="1.0" ?>
481290e2 2
ddf98968 3<makefile>
b6dc1b90 4
00100882 5 <requires version="0.2.7"/>
e2c10c59 6
ddf98968
VS
7 <!-- bakefile modules we need: -->
8 <using module="datafiles"/>
9
10 <!-- load python module with wxwindows helpers: -->
11 <using module="wxwin"/>
12
c8c1b0bf
DE
13 <!-- DFE: Add a platform meaning regular MacOS (not OS X) -->
14 <!-- FIXME: This will be handled in Bakefile but for now I wanted to
e2c10c59
WS
15 get my changes to the wx bakefiles in the tree but invisible to
16 windows toolkits and their config.xxx settings -->
17 <if cond="FORMAT=='autoconf'">
18 <option name="PLATFORM_MACOS"/>
19 </if>
20 <if cond="FORMAT!='autoconf'">
21 <set var="PLATFORM_MACOS">0</set>
22 </if>
c8c1b0bf 23
ddf98968 24 <include file="config.bkl"/>
c79241a2
VS
25
26 <include file="plugins_deps.bkl"/>
e2c10c59 27
bdc408c4 28
05a0bcde
VS
29 <!-- wxWidgets version numbers logic: -->
30 <include file="version.bkl"/>
e2c10c59 31
9043a590
VZ
32 <set var="ARCH_SUFFIX">
33 <if cond="FORMAT=='msevc4prj'">_$(CPU)</if>
235a997f
VZ
34 <if cond="TARGET_CPU=='amd64'">_x64</if>
35 <if cond="TARGET_CPU=='AMD64'">_x64</if>
9043a590
VZ
36 <if cond="TARGET_CPU=='ia64'">_ia64</if>
37 <if cond="TARGET_CPU=='IA64'">_ia64</if>
235a997f
VZ
38 <if cond="TARGET_CPU=='x64'">_x64</if>
39 <if cond="TARGET_CPU=='X64'">_x64</if>
9043a590
VZ
40 </set>
41
ddf98968
VS
42 <!-- ================================================================== -->
43 <!-- Names of libraries and DLLs: -->
44 <!-- ================================================================== -->
45
46 <set var="PORTNAME">
47 <if cond="USE_GUI=='0'">base</if>
48 <if cond="USE_GUI=='1'">$(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)</if>
49 </set>
e2c10c59 50
64a2a46f
VS
51 <set var="WXBASEPORT">
52 <if cond="TOOLKIT=='MAC'">_carbon</if>
53 </set>
ddf98968 54
9043a590
VZ
55 <!--
56 Optional compiler version, mainly for Windows compilers for which it is
57 supposed to be set on make command line for the official builds.
58 -->
59 <set var="COMPILER_VERSION" make_var="1">
60 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='1'">ERROR-COMPILER-VERSION-MUST-BE-SET-FOR-OFFICIAL-BUILD</if>
61 </set>
62
ddf98968
VS
63 <set var="COMPILERORGCC">
64 <if cond="isdefined('COMPILER')">$(COMPILER)</if>
65 <if cond="not isdefined('COMPILER')">gcc</if>
66 </set>
9043a590
VZ
67
68 <!--
69 In the official builds we use not only the compiler name but also its
70 version and architecture we compile for in the libraries names.
71 -->
ddf98968 72 <set var="WXCOMPILER">
9043a590
VZ
73 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='1'">_$(COMPILERORGCC)$(COMPILER_VERSION)$(ARCH_SUFFIX)</if>
74 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='0'">_$(COMPILERORGCC)</if>
ddf98968 75 </set>
4fc5f509
VS
76
77 <set var="VENDORTAG">
cff5df9f
VS
78 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='1'"></if>
79 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='0'">_$(VENDOR)</if>
4fc5f509
VS
80 </set>
81
c6684d42 82 <!-- debug suffix used for Windows libraries which use debug CRT -->
ddf98968 83 <set var="WXDEBUGFLAG">
c6684d42
VZ
84 <if cond="BUILD=='debug' and DEBUG_RUNTIME_LIBS=='default'">d</if>
85 <if cond="DEBUG_RUNTIME_LIBS=='1'">d</if>
ddf98968
VS
86 </set>
87 <set var="WXUNICODEFLAG">
af594eca
VS
88 <!-- WinCE is Unicode-only platform: -->
89 <if cond="UNICODE=='1' and FORMAT!='msevc4prj'">u</if>
ddf98968 90 </set>
c6684d42
VZ
91 <set var="WX_U_D_SUFFIX">
92 $(WXUNICODEFLAG)$(WXDEBUGFLAG)
93 </set>
ddf98968 94 <set var="WXNAMESUFFIX">
c6684d42 95 $(WX_U_D_SUFFIX)$(WX_LIB_FLAVOUR)
ddf98968 96 </set>
e2c10c59 97
ddf98968
VS
98 <set var="WXUNIVNAME">
99 <if cond="WXUNIV=='1'">univ</if>
100 </set>
101 <set var="WXUNIV_DEFINE">
102 <if cond="WXUNIV=='1'">__WXUNIVERSAL__</if>
103 </set>
104
cdc0282e 105 <if cond="FORMAT=='autoconf'">
64a2a46f 106 <set var="WXNAMEPREFIX">wx_base$(WXBASEPORT)</set>
cdc0282e 107 <set var="WXNAMEPREFIXGUI">wx_$(PORTNAME)$(WXUNIVNAME)</set>
a1bf307a 108 <set var="WXVERSIONTAG">-$(WX_RELEASE)</set>
cdc0282e
VS
109 </if>
110 <if cond="FORMAT!='autoconf'">
64a2a46f 111 <set var="WXNAMEPREFIX">
a1bf307a 112 wxbase$(WXBASEPORT)$(WX_RELEASE_NODOT)
64a2a46f
VS
113 </set>
114 <set var="WXNAMEPREFIXGUI">
a1bf307a 115 wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)</set>
cdc0282e
VS
116 <set var="WXVERSIONTAG"></set>
117 </if>
4fc5f509 118 <set var="WXDLLNAMEPREFIX">
64a2a46f 119 <if cond="PLATFORM_WIN32=='1'">
bdc408c4 120 wxbase$(WXBASEPORT)$(WXWIN32DLLVERSION)
64a2a46f 121 </if>
4fc5f509
VS
122 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIX)</if>
123 </set>
124 <set var="WXDLLNAMEPREFIXGUI">
125 <if cond="PLATFORM_WIN32=='1'">
bdc408c4 126 wx$(PORTNAME)$(WXUNIVNAME)$(WXWIN32DLLVERSION)
4fc5f509
VS
127 </if>
128 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIXGUI)</if>
129 </set>
130 <set var="WXDLLVERSIONTAG">
131 <if cond="PLATFORM_WIN32=='1'"></if>
132 <if cond="PLATFORM_WIN32=='0'">$(WXVERSIONTAG)</if>
133 </set>
ddf98968 134
e2c10c59 135
ddf98968
VS
136 <!-- =============================================================== -->
137 <!-- Names of component libraries: -->
138 <!-- =============================================================== -->
139
e86e1522
VS
140 <set var="WXLIB_BASE">
141 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('base')))</if>
142 </set>
7c4728f6
VS
143 <set var="WXLIB_NET">
144 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('net')))</if>
145 </set>
61639efb
VZ
146 <set var="WXLIB_QA">
147 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('qa')))</if>
148 </set>
ddf98968
VS
149 <set var="WXLIB_CORE">
150 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('core')))</if>
151 </set>
13cb46e0
VS
152 <set var="WXLIB_ADV">
153 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('adv')))</if>
154 </set>
2ae3b602 155 <set var="WXLIB_MEDIA">
03575f9b 156 <if cond="MONOLITHIC=='0' and USE_MEDIA=='1'">$(mk.evalExpr(wxwin.mkLibName('media')))</if>
2ae3b602 157 </set>
fab9850d 158 <set var="WXLIB_HTML">
e86e1522 159 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('html')))</if>
fab9850d 160 </set>
a69544bf
VS
161 <set var="WXLIB_XML">
162 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xml')))</if>
163 </set>
a62d8849
WS
164 <set var="WXLIB_XRC">
165 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xrc')))</if>
166 </set>
50acee04
JS
167 <set var="WXLIB_AUI">
168 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('aui')))</if>
169 </set>
3c3ead1d
PC
170 <set var="WXLIB_RIBBON">
171 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('ribbon')))</if>
172 </set>
1c4293cb
VZ
173 <set var="WXLIB_PROPGRID">
174 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('propgrid')))</if>
175 </set>
3b2cb431
JS
176 <set var="WXLIB_RICHTEXT">
177 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('richtext')))</if>
178 </set>
54429bb3
RD
179 <set var="WXLIB_STC">
180 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('stc')))</if>
181 </set>
467d261e 182 <set var="WXLIB_WEBVIEW">
ea10101a 183 <if cond="MONOLITHIC=='0' and USE_WEBVIEW=='1'">$(mk.evalExpr(wxwin.mkLibName('webview')))</if>
cfcf1d6e 184 </set>
ddf98968
VS
185 <set var="WXLIB_MONO">
186 <if cond="MONOLITHIC=='1'">$(mk.evalExpr(wxwin.mkLibName('mono')))</if>
187 </set>
e2c10c59
WS
188
189
ddf98968 190 <!-- =============================================================== -->
cff5df9f 191 <!-- Where to store built libraries and objects: -->
ddf98968 192 <!-- =============================================================== -->
e2c10c59 193
cff5df9f
VS
194 <if cond="FORMAT!='autoconf'">
195 <set var="WXDLLFLAG">
196 <if cond="SHARED=='1'">dll</if>
197 </set>
198 <set var="CFG_NAME_PART">
c6684d42 199 $(PORTNAME)$(WXUNIVNAME)$(WX_U_D_SUFFIX)$(WXDLLFLAG)$(CFG)
cff5df9f 200 </set>
dad909f7 201
4c51a665 202 <!-- NB: this is make_var so that it can be overridden on command line
dad909f7
VS
203 like this: nmake -f makefile.vc COMPILER_PREFIX=vc6 -->
204 <set var="COMPILER_PREFIX" make_var="1">$(COMPILER)</set>
205
328f5196 206 <set var="OBJS" make_var="1">
9043a590 207 $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(CFG_NAME_PART)$(ARCH_SUFFIX)
328f5196
VS
208 </set>
209
cff5df9f
VS
210 <set var="BUILDDIR">$(OBJS)</set>
211 </if>
e2c10c59 212
46da6d06 213 <set var="LIBTYPE_SUFFIX" make_var="1">
52abdc83
WS
214 <if cond="FORMAT!='autoconf' and SHARED=='0' and PLATFORM_WIN32=='1'">lib</if>
215 <if cond="FORMAT!='autoconf' and SHARED=='1' and PLATFORM_WIN32=='1'">dll</if>
216 <if cond="FORMAT=='watcom' and SHARED=='0' and PLATFORM_WIN32=='0'">$(TOOLKIT_LOWERCASE)_lib</if>
217 <if cond="FORMAT=='watcom' and SHARED=='1' and PLATFORM_WIN32=='0'">$(TOOLKIT_LOWERCASE)_dll</if>
46da6d06
WS
218 </set>
219
390c0cfb 220 <set var="LIBDIRNAME" make_var="1">
6589dc98 221 <if cond="FORMAT=='autoconf'">$(wx_top_builddir)/lib</if>
46da6d06 222 <if cond="FORMAT!='autoconf'">
9043a590 223 $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER_PREFIX)$(COMPILER_VERSION)$(ARCH_SUFFIX)_$(LIBTYPE_SUFFIX)$(CFG)
cff5df9f 224 </if>
ddf98968 225 </set>
e2c10c59 226
ee929bcf
VS
227 <if cond="FORMAT!='autoconf'">
228 <set var="SETUPHDIR" make_var="1">
c6684d42 229 $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WX_U_D_SUFFIX)
ee929bcf
VS
230 </set>
231 </if>
cff5df9f 232
e2c10c59
WS
233
234
4843dc4c
VS
235 <!-- =============================================================== -->
236 <!-- Templates for libs: -->
237 <!-- =============================================================== -->
cdc0282e 238
4f6e1dac
VS
239 <set var="DEBUGINFO">
240 <if cond="BUILD=='debug' and DEBUG_INFO=='default'">on</if>
241 <if cond="DEBUG_INFO=='1'">on</if>
242 <if cond="BUILD=='release' and DEBUG_INFO=='default'">off</if>
243 <if cond="DEBUG_INFO=='0'">off</if>
244 </set>
245 <set var="DEBUGRUNTIME">
51c4bf88
VS
246 <if cond="DEBUG_RUNTIME_LIBS=='default' and BUILD=='debug'">on</if>
247 <if cond="DEBUG_RUNTIME_LIBS=='default' and BUILD=='release'">off</if>
4f6e1dac
VS
248 <if cond="DEBUG_RUNTIME_LIBS=='0'">off</if>
249 <if cond="DEBUG_RUNTIME_LIBS=='1'">on</if>
cdc0282e
VS
250 </set>
251 <set var="OPTIMIZEFLAG">
546a7e42
VS
252 <if cond="BUILD=='debug'">off</if>
253 <if cond="BUILD=='release'">speed</if>
cdc0282e 254 </set>
9833a21a
VS
255 <set var="EXCEPTIONSFLAG">
256 <if cond="USE_EXCEPTIONS=='1'">on</if>
257 <if cond="USE_EXCEPTIONS=='0'">off</if>
258 </set>
c2efd890
VZ
259 <set var="RTTIFLAG">
260 <if cond="USE_RTTI=='1'">on</if>
261 <if cond="USE_RTTI=='0'">off</if>
262 </set>
d1e5aa07
VS
263 <set var="THREADSFLAG">
264 <if cond="USE_THREADS=='1'">multi</if>
265 <if cond="USE_THREADS=='0'">single</if>
266 </set>
15b44c69 267
b7e4c668 268 <set var="RTTI_DEFINE">
7121be53 269 <if cond="USE_RTTI=='0'">wxNO_RTTI</if>
b7e4c668
VZ
270 </set>
271 <set var="EXCEPTIONS_DEFINE">
7121be53 272 <if cond="USE_EXCEPTIONS=='0'">wxNO_EXCEPTIONS</if>
b7e4c668
VZ
273 </set>
274 <set var="THREAD_DEFINE">
7121be53 275 <if cond="USE_THREADS=='0'">wxNO_THREADS</if>
b7e4c668
VZ
276 </set>
277
15b44c69 278 <set var="DEBUG_DEFINE">
c6684d42 279 <if cond="DEBUG_FLAG=='0'">wxDEBUG_LEVEL=0</if>
15b44c69 280 </set>
c59422a4
VS
281 <set var="NDEBUG_DEFINE">
282 <if cond="FORMAT!='autoconf' and DEBUG_RUNTIME_LIBS=='default' and BUILD=='release'">NDEBUG</if>
283 <if cond="FORMAT!='autoconf' and DEBUG_RUNTIME_LIBS=='0'">NDEBUG</if>
284 </set>
285
4435bd42
MB
286 <!-- does not cover all cases, but better than nothing -->
287 <set var="NO_VC_CRTDBG">
288 <if cond="FORMAT=='msvc' and BUILD=='debug' and DEBUG_RUNTIME_LIBS=='0'">__NO_VC_CRTDBG__</if>
289 <if cond="FORMAT=='msvc' and BUILD=='release' and DEBUG_FLAG=='1'">__NO_VC_CRTDBG__</if>
290 </set>
15b44c69 291 <set var="UNICODE_DEFINE">
ed4ccecd 292 <if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if>
9c7ad546 293 <if cond="FORMAT!='autoconf' and UNICODE=='0'">wxUSE_UNICODE=0</if>
15b44c69 294 </set>
22df8343 295 <set var="MSLU_DEFINE">
a649ec01 296 <if cond="FORMAT!='autoconf' and MSLU=='1'">wxUSE_UNICODE_MSLU=1</if>
22df8343 297 </set>
e2c10c59 298
5fae0f97
WS
299 <!-- fill for the specific case of the format/compiler -->
300 <set var="WIN32_WINNT">
301 <if cond="FORMAT=='dmars' or FORMAT=='dmars_smake'">_WIN32_WINNT=0x0400</if>
302 </set>
303
416f5bc8
VS
304 <set var="UNICOWS_LIB">
305 <if cond="MSLU=='1'">unicows</if>
306 </set>
f82b7036
KO
307 <set var="CAIRO_LIB">
308 <if cond="USE_CAIRO=='1'">cairo</if>
309 </set>
310 <set var="CAIRO_LIBDIR">
311 <if cond="USE_CAIRO=='1'">$(DOLLAR)(CAIRO_ROOT)/lib</if>
312 </set>
313 <set var="CAIRO_INCLUDEDIR">
314 <if cond="USE_CAIRO=='1'">$(DOLLAR)(CAIRO_ROOT)/include/cairo</if>
315 </set>
2713e629 316
e40b74ba 317 <set var="LINK_TARGET_CPU">
94b6ce7f
VZ
318 <if cond="TARGET_CPU=='amd64'">/MACHINE:X64</if>
319 <if cond="TARGET_CPU=='AMD64'">/MACHINE:X64</if>
b974b0da 320 <if cond="TARGET_CPU=='ia64'">/MACHINE:IA64</if>
e40b74ba 321 <if cond="TARGET_CPU=='IA64'">/MACHINE:IA64</if>
235a997f
VZ
322 <if cond="TARGET_CPU=='x64'">/MACHINE:X64</if>
323 <if cond="TARGET_CPU=='X64'">/MACHINE:X64</if>
e40b74ba 324 </set>
e40b74ba 325
149cc218 326 <template id="common_settings">
4f6e1dac
VS
327 <debug-info>$(DEBUGINFO)</debug-info>
328 <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
5e3746dc 329 <optimize>$(OPTIMIZEFLAG)</optimize>
d1e5aa07 330 <threading>$(THREADSFLAG)</threading>
4b44ea2b 331 <runtime-libs>$(RUNTIME_LIBS)</runtime-libs>
c2efd890 332 <cxx-rtti>$(RTTIFLAG)</cxx-rtti>
9833a21a 333 <cxx-exceptions>$(EXCEPTIONSFLAG)</cxx-exceptions>
5e3746dc
VS
334 <if cond="FORMAT!='autoconf'">
335 <cppflags>$(EXTRACFLAGS)</cppflags>
336 </if>
4707c7c3 337 <!-- Suppress deprecation warnings for standard library calls -->
49a63afb 338 <if cond="FORMAT in ['msvc','msvs2005prj','msvs2008prj']">
4707c7c3
VZ
339 <define>_CRT_SECURE_NO_DEPRECATE=1</define>
340 <define>_CRT_NON_CONFORMING_SWPRINTFS=1</define>
341 <define>_SCL_SECURE_NO_WARNINGS=1</define>
342 </if>
343
4435bd42 344 <define>$(NO_VC_CRTDBG)</define>
5fae0f97 345 <define>$(WIN32_WINNT)</define>
e40b74ba
MW
346 <if cond="FORMAT=='msvc'">
347 <ldflags>$(LINK_TARGET_CPU)</ldflags>
e40b74ba 348 </if>
92d594fc 349 <include cond="FORMAT=='msevc4prj'">$(TOP_SRCDIR)build/wince/missing</include>
5e3746dc 350 </template>
e2c10c59 351
4843dc4c 352 <template id="anylib">
4843dc4c
VS
353 <dirname>$(LIBDIRNAME)</dirname>
354 <install-to>$(LIBDIR)</install-to>
355 </template>
356
149cc218 357 <template id="3rdparty_lib" template="common_settings,anylib">
a1bf307a 358 <if cond="FORMAT=='autoconf'">
c6684d42 359 <libname>$(id)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)</libname>
a1bf307a
RL
360 </if>
361 <if cond="FORMAT!='autoconf'">
9c2d002b 362 <libname>$(id)$(WXDEBUGFLAG)$(HOST_SUFFIX)</libname>
a1bf307a 363 </if>
52a5a009
VS
364 <!--
365 we want to install 3rd party libs system-wide only with static
77ffb593 366 version of wxWidgets; otherwise they are embedded in shared libs:
52a5a009
VS
367 -->
368 <install-if>SHARED=='0'</install-if>
af594eca 369 <pic>$(substituteFromDict(SHARED, {'0':'off', '1':'on'}))</pic>
9dab58b1
VZ
370
371 <!--
372 we don't want to have asserts in the 3rd party libraries code,
373 neither we nor wx users are interested in debugging them anyhow
374 -->
375 <define>NDEBUG</define>
41c89b91
VZ
376
377 <if cond="IS_MSVC">
378 <!--
379 we're not interested in deprecation warnings about the use of
380 standard C functions in the 3rd party libraries (these warnings
381 are only given by VC8+ but it's simpler to just always define
382 this symbol which disables them, even for previous VC versions)
383 -->
384 <define>_CRT_SECURE_NO_WARNINGS</define>
385 </if>
82cb0280 386 </template>
e2c10c59
WS
387
388
cb9548d9 389 <!-- deal with the need to copy setup.h here: -->
82cb0280 390
cb9548d9 391 <define-tag name="msvc-headers" rules="dll,lib">
af594eca 392 <if cond="IS_MSVC_PRJ">
79a2ea34
VS
393 <msvc-project-files>
394 $(addPrefixToList('include\\', wxwin.headersOnly(value)))
395 </msvc-project-files>
cb9548d9
VS
396 </if>
397 </define-tag>
398
c7f476c9 399 <set var="msvc_copy_setup_h_script">
cc118a9b
VS
400 <if cond="IS_MSVC_PRJ=='1' and FORMAT not in ['msvc6prj','msevc4prj']">
401Creating $(SETUPHDIR)\wx\setup.h
402InputPath=..\..\include\wx\%s
403
404"$(SETUPHDIR)\wx\setup.h" :
405$(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
406 </if>
407 <if cond="IS_MSVC_PRJ=='1' and FORMAT in ['msvc6prj','msevc4prj']">
cb9548d9 408Creating $(SETUPHDIR)\wx\setup.h
9c26fe83 409InputPath=..\..\include\wx\%s
cb9548d9
VS
410
411"$(SETUPHDIR)\wx\setup.h" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
412$(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
c7f476c9
MW
413 </if>
414 </set>
415
416 <define-tag name="msvc-headers-setup-h" rules="dll,lib">
417 <if cond="IS_MSVC_PRJ">
418 <msvc-headers>
419 $(addPrefixToList('wx/', value))
420 </msvc-headers>
421 <set var="_custom_build_files" append="1">
422 $(nativePaths(addPrefixToList('include/wx/', value)))
cb9548d9
VS
423 </set>
424 </if>
425 </define-tag>
426
c7f476c9
MW
427 <define-tag name="msvc-copy-setup-h" rules="dll,lib">
428 <if cond="IS_MSVC_PRJ">
429 <if cond="FORMAT=='msevc4prj'">
430 <msvc-headers-setup-h>
431 msw/wince/setup.h
432 </msvc-headers-setup-h>
433 <set var="_custom_build_include_wx_msw_wince_setup_h">
434 $(msvc_copy_setup_h_script % 'msw\wince\setup.h')
435 </set>
436 </if>
437 <if cond="FORMAT!='msevc4prj'">
0053219f
VZ
438 <msvc-headers-setup-h>
439 msw/setup.h
440 univ/setup.h
441 </msvc-headers-setup-h>
c7f476c9 442 <set var="_custom_build_include_wx_msw_setup_h">
5c3f21c6 443 <if cond="WXUNIV=='0' and TOOLKIT=='MSW'">
c7f476c9
MW
444 $(msvc_copy_setup_h_script % 'msw\setup.h')
445 </if>
446 </set>
d48f13a1
VZ
447 <set var="_custom_build_include_wx_gtk_setup_h">
448 <if cond="WXUNIV=='0' and TOOLKIT=='GTK'">
449 $(msvc_copy_setup_h_script % 'gtk\setup.h')
450 </if>
451 </set>
c7f476c9
MW
452 <set var="_custom_build_include_wx_univ_setup_h">
453 <if cond="WXUNIV=='1'">
454 $(msvc_copy_setup_h_script % 'univ\setup.h')
455 </if>
456 </set>
457 </if>
458 </if>
459 </define-tag>
460
c8d58531
MW
461 <define-tag name="msvc-create-rcdefs-h" rules="dll,lib">
462 <if cond="IS_MSVC_PRJ">
463 <msvc-headers-setup-h>
464 msw/genrcdefs.h
465 </msvc-headers-setup-h>
92641c0d 466 <!-- FIXME: we need another way to get the compiler name -->
c8d58531
MW
467 <set var="VC_COMPILER">
468 <if cond="FORMAT=='msevc4prj'">$(_COMPILER)</if>
469 <if cond="FORMAT!='msevc4prj'">cl</if>
470 </set>
471 <set var="_custom_build_include_wx_msw_genrcdefs_h">
472Creating $(SETUPHDIR)\wx\msw\rcdefs.h
9c26fe83 473InputPath=..\..\include\wx\msw\genrcdefs.h
c8d58531 474
81073d92 475"$(SETUPHDIR)\wx\msw\rcdefs.h" : "$(DOLLAR)(SOURCE)" "$(SETUPHDIR)\wx\msw"
c8d58531
MW
476$(TAB)$(VC_COMPILER) /EP /nologo "$(DOLLAR)(InputPath)" > "$(SETUPHDIR)\wx\msw\rcdefs.h"
477 </set>
478 </if>
479 </define-tag>
480
cb9548d9
VS
481 <template id="msvc_setup_h">
482 <msvc-copy-setup-h/>
c8d58531 483 <msvc-create-rcdefs-h/>
cb9548d9 484 </template>
ddf98968
VS
485
486 <!-- =============================================================== -->
487 <!-- 3rd party libs: -->
488 <!-- =============================================================== -->
e2c10c59 489
ddf98968
VS
490 <!-- 3rd party libraries: -->
491 <include file="regex.bkl"/>
492 <include file="zlib.bkl"/>
493 <include file="png.bkl"/>
494 <include file="jpeg.bkl"/>
495 <include file="tiff.bkl"/>
a69544bf 496 <include file="expat.bkl"/>
54429bb3 497 <include file="scintilla.bkl"/>
ddf98968 498
e2c10c59 499
ddf98968 500 <!-- =============================================================== -->
77ffb593 501 <!-- Templates for wxWidgets libs: -->
ddf98968 502 <!-- =============================================================== -->
cdc0282e 503
2cc75628
VS
504 <!-- NB: in monolithic build, even wxBase-only must be linked against
505 GUI extralibs, otherwise there would be unresolved references.
506 The variables below are defined so that all libs are used
507 in monolithic build, but not in multilib one. -->
508 <set var="EXTRALIBS_FOR_BASE">
51ec29ea 509 <if cond="MONOLITHIC=='1'">$(EXTRALIBS) $(EXTRALIBS_XML) $(EXTRALIBS_GUI)</if>
2cc75628
VS
510 <if cond="MONOLITHIC=='0'">$(EXTRALIBS)</if>
511 </set>
512 <set var="EXTRALIBS_FOR_GUI">
513 <if cond="MONOLITHIC=='1'"></if>
514 <if cond="MONOLITHIC=='0'">$(EXTRALIBS_GUI)</if>
515 </set>
516
d48f13a1
VZ
517 <!-- GTK+ under Windows requires -mms-bitfields gcc switch -->
518 <set var="CXXFLAGS_GTK_WINDOWS_GCC">
519 <if cond="TOOLKIT=='GTK' and FORMAT=='mingw'">-mms-bitfields</if>
520 </set>
521
149cc218 522 <template id="wx" template="common_settings">
ddf98968
VS
523 <set var="wxid">$(wxwin.mk_wxid(id))</set>
524 <define>__WX$(TOOLKIT)__</define>
525 <define>$(WXUNIV_DEFINE)</define>
15b44c69 526 <define>$(DEBUG_DEFINE)</define>
c59422a4 527 <define>$(NDEBUG_DEFINE)</define>
b7e4c668
VZ
528 <define>$(EXCEPTIONS_DEFINE)</define>
529 <define>$(RTTI_DEFINE)</define>
530 <define>$(THREAD_DEFINE)</define>
15b44c69 531 <define>$(UNICODE_DEFINE)</define>
22df8343 532 <define>$(MSLU_DEFINE)</define>
c8d58531 533 <include cond="FORMAT!='autoconf'">$(SETUPHDIR)</include>
85ebb95c 534 <include cond="FORMAT!='autoconf'">$(TOP_SRCDIR)include</include>
f82b7036 535 <include cond="FORMAT!='autoconf'">$(CAIRO_INCLUDEDIR)</include>
e2c10c59 536 <lib-path>$(LIBDIRNAME)</lib-path>
b1b592ad 537
432afc17 538 <warnings>max</warnings>
b1b592ad 539 <cxxflags cond="FORMAT=='autoconf'">$(CXXWARNINGS)</cxxflags>
a0177486
WS
540 <cppflags-watcom>
541 -wcd=549 <!-- 'sizeof' operand contains compiler generated information -->
542 -wcd=656 <!-- define this function inside its class definition (may improve code quality) -->
543 -wcd=657 <!-- define this function inside its class definition (could have improved code quality) -->
544 -wcd=667 <!-- 'va_start' macro will not work without an argument before '...' -->
545 </cppflags-watcom>
329a2be8 546 <cxxflags-mingw>
f8fbc92b 547 -Wno-ctor-dtor-privacy <!-- only defines a private destructor and has no friends -->
d48f13a1 548 $(CXXFLAGS_GTK_WINDOWS_GCC)
329a2be8 549 </cxxflags-mingw>
ddf98968
VS
550 </template>
551
c74dc163 552 <!-- for both GUI and wxBase libs/samples: -->
e83a52a2 553 <template id="wx_append_base_nomono">
ddf98968 554 <!-- link against builtin 3rd party libs, if needed: -->
ddf98968 555 <sys-lib>$(LIB_ZLIB)</sys-lib>
ddf98968 556 <sys-lib>$(LIB_REGEX)</sys-lib>
a69544bf 557 <sys-lib>$(LIB_EXPAT)</sys-lib>
e2c10c59 558
2cc75628 559 <ldlibs>$(EXTRALIBS_FOR_BASE)</ldlibs>
15b44c69 560
52abdc83
WS
561 <!-- system libraries on os2: -->
562 <if cond="FORMAT!='autoconf' and PLATFORM_OS2=='1'">
563 <if cond="FORMAT=='watcom'">
564 <sys-lib>upm32</sys-lib>
565 </if>
566 </if>
567
15b44c69 568 <!-- system libraries on windows: -->
52abdc83 569 <if cond="FORMAT!='autoconf' and PLATFORM_WIN32=='1'">
416f5bc8 570 <sys-lib>$(UNICOWS_LIB)</sys-lib>
f82b7036
KO
571 <sys-lib>$(CAIRO_LIB)</sys-lib>
572 <lib-path>$(CAIRO_LIBDIR)</lib-path>
328f5196 573 <if cond="FORMAT=='borland'">
cb8bbc13
VS
574 <sys-lib>ole2w32</sys-lib>
575 </if>
f9c4805a
VS
576 <if cond="FORMAT=='msevc4prj'">
577 <sys-lib>ole32</sys-lib>
578 <sys-lib>oleaut32</sys-lib>
579 <sys-lib>uuid</sys-lib>
580 <sys-lib>commctrl</sys-lib>
f9c4805a
VS
581 <sys-lib>winsock</sys-lib>
582 <sys-lib>wininet</sys-lib>
583 </if>
584 <if cond="FORMAT!='borland' and FORMAT!='msevc4prj'">
cb8bbc13
VS
585 <sys-lib>kernel32</sys-lib>
586 <sys-lib>user32</sys-lib>
587 <sys-lib>gdi32</sys-lib>
588 <sys-lib>comdlg32</sys-lib>
589 <sys-lib>winspool</sys-lib>
590 <sys-lib>winmm</sys-lib>
591 <sys-lib>shell32</sys-lib>
cb8bbc13 592 <sys-lib>comctl32</sys-lib>
cb8bbc13
VS
593 <sys-lib>ole32</sys-lib>
594 <sys-lib>oleaut32</sys-lib>
595 <sys-lib>uuid</sys-lib>
596 <sys-lib>rpcrt4</sys-lib>
597 <sys-lib>advapi32</sys-lib>
598 <sys-lib>wsock32</sys-lib>
b44f5137
VZ
599 <!-- this one is only used if wxUSE_URL_NATIVE==1 but we don't
600 know if it is here so just add it unconditionally -->
601 <sys-lib>wininet</sys-lib>
15b44c69 602 </if>
1b48afd2 603 <if cond="FORMAT=='borland'">
3682ea7d
VS
604 <sys-lib>oleacc</sys-lib>
605 </if>
57670219 606 </if>
ddf98968
VS
607 </template>
608
d48f13a1
VZ
609 <set var="LIB_GTK">
610 <if cond="FORMAT!='autoconf' and PLATFORM_WIN32=='1' and TOOLKIT=='GTK' and TOOLKIT_VERSION=='2'">gtk-win32-2.0.lib gdk-win32-2.0.lib pangocairo-1.0.lib gdk_pixbuf-2.0.lib cairo.lib pango-1.0.lib gobject-2.0.lib gthread-2.0.lib glib-2.0.lib</if>
611 </set>
82ca3afe 612
c74dc163 613 <!-- for GUI libs/samples: -->
0019dee6
VS
614 <template id="wx_append_nomono" template_append="wx_append_base_nomono">
615 <sys-lib>$(LIB_TIFF)</sys-lib>
616 <sys-lib>$(LIB_JPEG)</sys-lib>
617 <sys-lib>$(LIB_PNG)</sys-lib>
d48f13a1 618 <ldlibs>$(LIB_GTK)</ldlibs>
2cc75628 619 <ldlibs>$(EXTRALIBS_FOR_GUI)</ldlibs>
c74dc163
VS
620 </template>
621
57c74474
VZ
622 <set var="LIB_PNG_IF_MONO">
623 <if cond="MONOLITHIC=='1'">$(LIB_PNG)</if>
624 </set>
e83a52a2 625
a4830bb5 626 <set var="LIB_SCINTILLA_IF_MONO">
c80ae454 627 <if cond="MONOLITHIC=='1' and USE_STC=='1'">$(LIB_SCINTILLA)</if>
a4830bb5
VZ
628 </set>
629
e83a52a2 630 <template id="wx_append_base" template_append="wx_append_base_nomono">
57c74474
VZ
631 <!-- Always link against the full wx library in monolithic build and
632 also against the PNG one as core code references it for Tango
633 icons and so it is pulled in even by the console programs. -->
e83a52a2 634 <sys-lib>$(WXLIB_MONO)</sys-lib>
57c74474 635 <sys-lib>$(LIB_PNG_IF_MONO)</sys-lib>
e83a52a2
VS
636 </template>
637 <template id="wx_append" template_append="wx_append_nomono">
638 <!-- Always link against the wxWin library in monolithic build: -->
639 <sys-lib>$(WXLIB_MONO)</sys-lib>
a4830bb5 640 <sys-lib>$(LIB_SCINTILLA_IF_MONO)</sys-lib>
e83a52a2 641 </template>
e2c10c59 642
e83a52a2 643
0469579d 644 <set var="WX_DISABLE_PRECOMP_HEADERS" overwrite="0">0</set>
e2c10c59 645
4843dc4c 646 <template id="wx_lib_b" template="wx,anylib">
ddf98968 647 <set var="WXLIBNAME">$(wxwin.mkLibName(wxid))</set>
ddf98968 648 <libname>$(WXLIBNAME)</libname>
cb8bbc13 649
5d88a6b5
VZ
650 <define>WXBUILDING</define>
651
0469579d 652 <if cond="WX_DISABLE_PRECOMP_HEADERS=='0'">
5c3f21c6 653 <if cond="FORMAT!='autoconf'">
66b9f7f7 654 <sources>$(WXTOPDIR)src/common/dummy.cpp</sources>
0469579d 655 <precomp-headers-gen>
66b9f7f7 656 $(WXTOPDIR)src/common/dummy.cpp
0469579d
VS
657 </precomp-headers-gen>
658 </if>
a420c7ed 659 <precomp-headers-location>$(WXTOPDIR)include</precomp-headers-location>
0469579d
VS
660 <precomp-headers-header>wx/wxprec.h</precomp-headers-header>
661 <precomp-headers>on</precomp-headers>
662 <precomp-headers-file>wxprec_$(id)</precomp-headers-file>
3fe70739 663 <precomp-headers-exclude>
3fe70739 664 src/common/extended.c
e762ef8f
VZ
665 src/gtk/eggtrayicon.c
666 src/gtk/treeentry_gtk.c
3fe70739 667 </precomp-headers-exclude>
cb8bbc13 668 </if>
e2c10c59 669
3a811096 670 <if cond="IS_MSVC_PRJ=='1' and BUILDING_LIB=='1'">
82ca3afe 671 <msvc-file-group>Common Sources:src/common/*</msvc-file-group>
d48f13a1 672 <msvc-file-group>GTK+ Sources:src/gtk/*</msvc-file-group>
82ca3afe
VS
673 <msvc-file-group>MSW Sources:src/msw/*</msvc-file-group>
674 <msvc-file-group>Generic Sources:src/generic/*</msvc-file-group>
675 <msvc-file-group>wxUniv Sources:src/univ/*</msvc-file-group>
676 <msvc-file-group>wxHTML Sources:src/html/*</msvc-file-group>
677 <msvc-file-group>Setup Headers:*/setup.h</msvc-file-group>
d48f13a1 678 <msvc-file-group>GTK+ Headers:*wx/gtk/*.h</msvc-file-group>
82ca3afe
VS
679 <msvc-file-group>MSW Headers:*wx/msw/*.h</msvc-file-group>
680 <msvc-file-group>Generic Headers:*wx/generic/*.h</msvc-file-group>
681 <msvc-file-group>wxUniv Headers:*wx/univ/*.h</msvc-file-group>
682 <msvc-file-group>wxHTML Headers:*wx/html/*.h</msvc-file-group>
cbba971f 683 <msvc-file-group>Common Headers:*wx/*.h</msvc-file-group>
82ca3afe 684 </if>
ddf98968 685 </template>
cb8bbc13 686
c8d58531
MW
687 <if cond="FORMAT=='autoconf'">
688 <set var="RCDEFDIR">
689 <if cond="TOOLKIT=='MSW'">
690 $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME)
691 </if>
692 </set>
693 </if>
694
fab9850d 695 <template id="wx_dll_b" template="wx_lib_b">
ddf98968
VS
696 <set var="WXDLLNAME">$(wxwin.mkDllName(wxid))</set>
697 <dllname>$(WXDLLNAME)</dllname>
698 <version>$(WX_VERSION)</version>
699 <so_version>$(WXSOVERSION)</so_version>
7121be53 700
31da10de
VS
701 <!-- FIXME: until libtool scheme is implemented in bakefile -->
702 <ldflags cond="FORMAT=='autoconf'">$(WXMACVERSION_CMD)</ldflags>
d181c36e
VS
703
704 <!-- version info resources: -->
79a2ea34
VS
705 <res-define>WXDLLNAME=$(WXDLLNAME)</res-define>
706 <if cond="FORMAT=='autoconf'">
707 <res-include>$(RCDEFDIR)</res-include>
708 <res-include>$(TOP_SRCDIR)include</res-include>
19beefa6 709 <postlink-command>$(DYLIB_RPATH_POSTLINK)</postlink-command>
260c165f 710 </if>
102d46f3 711 <win32-res>$(WXTOPDIR)src/msw/version.rc</win32-res>
d48f13a1 712
ddf98968 713 </template>
c0608865 714
0bcf9597 715 <template id="wx_3rdparty_dependencies_gui" cond="USE_GUI=='1'">
3fe70739
VS
716 <depends>wxtiff</depends>
717 <depends>wxjpeg</depends>
718 <depends>wxpng</depends>
303a585d 719 <depends>wxscintilla</depends>
0bcf9597
WS
720 </template>
721
722 <template id="wx_3rdparty_dependencies"
723 template="wx_3rdparty_dependencies_gui">
390c0cfb 724 <depends>wxexpat</depends>
c74dc163
VS
725 <depends>wxzlib</depends>
726 <depends>wxregex</depends>
727 </template>
ee929bcf 728
0bcf9597 729 <template id="wx_3rdparty_includes_gui" cond="USE_GUI=='1'">
3442c078 730 <include>$(INC_TIFF_BUILD)</include>
ee929bcf
VS
731 <include>$(INC_TIFF)</include>
732 <include>$(INC_JPEG)</include>
733 <include>$(INC_PNG)</include>
0bcf9597
WS
734 </template>
735
736 <template id="wx_3rdparty_includes"
737 template="wx_3rdparty_includes_gui">
ee929bcf 738 <include>$(INC_ZLIB)</include>
ee929bcf
VS
739 <include>$(INC_REGEX)</include>
740 <include>$(INC_EXPAT)</include>
741 </template>
e2c10c59 742
9698d244
VS
743 <template id="wx_lib"
744 template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h"/>
745 <template id="wx_base_lib"
746 template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h">
e2c10c59 747 <define>wxUSE_GUI=0</define>
15d93f1e
VS
748 </template>
749
ee929bcf
VS
750 <template id="wx_dll"
751 template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
9698d244 752 template_append="msvc_setup_h,wx_append_nomono"/>
ee929bcf
VS
753 <template id="wx_base_dll"
754 template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
9698d244 755 template_append="msvc_setup_h,wx_append_base_nomono">
e2c10c59 756 <define>wxUSE_GUI=0</define>
15d93f1e 757 </template>
e2c10c59 758
ae4ae157 759 <!-- =============================================================== -->
77ffb593 760 <!-- Templates for building wxWidgets plugins: -->
ae4ae157
VS
761 <!-- =============================================================== -->
762
ae4ae157 763 <if cond="WX_STABLE_BRANCH=='1'">
c79241a2 764 <set var="PLUGIN_VERSION0">
a1bf307a
RL
765 <if cond="PLATFORM_UNIX=='1'">$(WX_RELEASE)</if>
766 <if cond="PLATFORM_UNIX=='0'">$(WX_RELEASE_NODOT)</if>
ae4ae157
VS
767 </set>
768 </if>
769 <if cond="WX_STABLE_BRANCH=='0'">
c79241a2 770 <set var="PLUGIN_VERSION0">
a1bf307a
RL
771 <if cond="PLATFORM_UNIX=='1'">$(WX_VERSION)</if>
772 <if cond="PLATFORM_UNIX=='0'">$(WX_VERSION_NODOT)</if>
ae4ae157
VS
773 </set>
774 </if>
c79241a2
VS
775 <set var="PLUGVERDELIM">
776 <if cond="PLATFORM_UNIX=='1'">-</if>
777 <if cond="PLATFORM_UNIX=='0'"></if>
778 </set>
779 <set var="PLUGIN_VERSION">$(PLUGVERDELIM)$(PLUGIN_VERSION0)</set>
e2c10c59 780
c79241a2
VS
781 <set var="PLUGINS_INST_DIR" make_var="1">
782 $(LIBDIR)/wx/$(PLUGIN_VERSION0)
783 </set>
ae4ae157
VS
784
785 <define-rule name="wx-base-plugin" extends="module">
786 <template>
787 <dllname>
c6684d42 788 $(id)$(WX_U_D_SUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
ae4ae157
VS
789 </dllname>
790 <define>WXUSINGDLL</define>
15d93f1e 791 <define>wxUSE_GUI=0</define>
c79241a2 792 <install-to>$(PLUGINS_INST_DIR)</install-to>
ae4ae157
VS
793 </template>
794 </define-rule>
e2c10c59 795
ae4ae157
VS
796 <define-rule name="wx-gui-plugin" extends="module">
797 <template template="wx">
798 <dllname>
c6684d42 799 $(id)_$(PORTNAME)$(WXUNIVNAME)$(WX_U_D_SUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
ae4ae157
VS
800 </dllname>
801 <define>WXUSINGDLL</define>
c79241a2 802 <install-to>$(PLUGINS_INST_DIR)</install-to>
ae4ae157
VS
803 </template>
804 </define-rule>
e2c10c59 805
ddf98968 806 <!-- =============================================================== -->
591a3be4 807 <!-- Support for wxWidgets samples: -->
ddf98968
VS
808 <!-- =============================================================== -->
809
810 <!-- Link against one wxWin library. Value must be literal! -->
485a205e 811 <define-tag name="wx-lib" rules="exe,dll,module">
ddf98968 812 <sys-lib>$(wxwin.libToLink(value))</sys-lib>
22cef566 813 <ldlibs>$(wxwin.extraLdflags(value))</ldlibs>
7a4fa569 814 <!-- msvs200?prj formats don't support external dependencies yet: -->
5acf8f1d 815 <if cond="FORMAT in ['msvc6prj','msevc4prj'] and MONOLITHIC=='0'">
dce0742b 816 <depends-on-dsp>$(wxwin.makeDspDependency(value))</depends-on-dsp>
7bd54b68 817 </if>
ddf98968
VS
818 </define-tag>
819
4bae0a94
VS
820
821 <!-- A hack to keep autoconf happy (we pass CPPFLAGS that contain
822 {top_srcdir} from configure, poor bakefile can't know that
823 and won't output top_srcdir = @top_srcdir@ line): -->
824 <set var="VARS_DONT_ELIMINATE" append="1">top_srcdir</set>
825
826
ddf98968 827</makefile>