]> git.saurik.com Git - wxWidgets.git/blame - include/msvc/wx/setup.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / msvc / wx / setup.h
CommitLineData
e5099bdf 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: msvc/wx/setup.h
e5099bdf
VZ
3// Purpose: wrapper around the real wx/setup.h for Visual C++
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 2004-12-12
e5099bdf
VZ
7// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
c82c5274
VZ
11#ifndef _MSC_VER
12 #error "This file should only be included when using Microsoft Visual C++"
13#endif
14
e5099bdf
VZ
15// VC++ IDE predefines _DEBUG and _UNICODE for the new projects itself, but
16// the other symbols (WXUSINGDLL, __WXUNIVERSAL__, ...) should be defined
3103e8a9 17// explicitly!
e5099bdf 18
c82c5274
VZ
19#include "wx/version.h"
20#include "wx/cpp.h"
21
22// notice that wxSUFFIX_DEBUG is a string but wxSUFFIX itself must be an
23// identifier as string concatenation is not done inside #include where we
24// need it
25#ifdef _DEBUG
26 #define wxSUFFIX_DEBUG "d"
27 #ifdef _UNICODE
28 #define wxSUFFIX ud
29 #else // !_UNICODE
30 #define wxSUFFIX d
31 #endif // _UNICODE/!_UNICODE
32#else
33 #define wxSUFFIX_DEBUG ""
34 #ifdef _UNICODE
35 #define wxSUFFIX u
36 #else // !_UNICODE
d70fe85f
VZ
37 // don't define wxSUFFIX at all as preprocessor operations don't work
38 // with empty values so we need to check for this case specially below
c82c5274
VZ
39 #endif // _UNICODE/!_UNICODE
40#endif
d57b7160 41
18a4c97b
VZ
42// compiler-specific prefix: by default it's always just "vc" for compatibility
43// reasons but if you use multiple MSVC versions you probably build them with
44// COMPILER_PREFIX=vcXX and in this case you may want to either predefine
45// wxMSVC_VERSION as "XX" or define wxMSVC_VERSION_AUTO to use the appropriate
46// version depending on the compiler used
47#ifdef wxMSVC_VERSION
2c8c1de1 48 #define wxCOMPILER_PREFIX wxCONCAT(vc, wxMSVC_VERSION)
18a4c97b
VZ
49#elif defined(wxMSVC_VERSION_AUTO)
50 #if _MSC_VER == 1200
51 #define wxCOMPILER_PREFIX vc60
52 #elif _MSC_VER == 1300
53 #define wxCOMPILER_PREFIX vc70
54 #elif _MSC_VER == 1310
55 #define wxCOMPILER_PREFIX vc71
56 #elif _MSC_VER == 1400
57 #define wxCOMPILER_PREFIX vc80
58 #elif _MSC_VER == 1500
59 #define wxCOMPILER_PREFIX vc90
60 #elif _MSC_VER == 1600
61 #define wxCOMPILER_PREFIX vc100
41087dc9
VZ
62 #elif _MSC_VER == 1700
63 #define wxCOMPILER_PREFIX vc110
72c5855f
VZ
64 #elif _MSC_VER == 1800
65 #define wxCOMPILER_PREFIX vc120
18a4c97b
VZ
66 #else
67 #error "Unknown MSVC compiler version, please report to wx-dev."
68 #endif
69#else
70 #define wxCOMPILER_PREFIX vc
71#endif
d48a4705
VZ
72
73// architecture-specific part: not used (again, for compatibility), for x86
74#if defined(_M_X64)
97981439 75 #define wxARCH_SUFFIX _x64
d48a4705
VZ
76#elif defined(_M_IA64)
77 #define wxARCH_SUFFIX _ia64
78#else // assume _M_IX86
79 #define wxARCH_SUFFIX
80#endif
81
da0a2aca
VZ
82// Ensure the library configuration is defined
83#ifndef wxCFG
84 #define wxCFG
85#endif
86
87// Construct the path for the subdirectory under /lib/ that the included setup.h
88// will be used from
c82c5274 89#ifdef WXUSINGDLL
da0a2aca
VZ
90 #define wxLIB_SUBDIR \
91 wxCONCAT4(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _dll, wxCFG)
c82c5274 92#else // !DLL
da0a2aca
VZ
93 #define wxLIB_SUBDIR \
94 wxCONCAT4(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _lib, wxCFG)
c82c5274 95#endif // DLL/!DLL
d57b7160 96
7d2295a0
VZ
97// The user can predefine a different prefix if not using the default MSW port
98// with MSVC.
99#ifndef wxTOOLKIT_PREFIX
d48f13a1
VZ
100 #if defined(__WXGTK__)
101 #define wxTOOLKIT_PREFIX gtk2
102 #else
103 #define wxTOOLKIT_PREFIX msw
104 #endif
7d2295a0 105#endif // wxTOOLKIT_PREFIX
d57b7160 106
c82c5274
VZ
107// the real setup.h header file we need is in the build-specific directory,
108// construct the path to it
d70fe85f
VZ
109#ifdef wxSUFFIX
110 #define wxSETUPH_PATH \
7d2295a0 111 wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)
d70fe85f
VZ
112#else // suffix is empty
113 #define wxSETUPH_PATH \
7d2295a0 114 wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, /wx/setup.h)
d70fe85f
VZ
115#endif
116
c82c5274 117#define wxSETUPH_PATH_STR wxSTRINGIZE(wxSETUPH_PATH)
d57b7160 118
c82c5274 119#include wxSETUPH_PATH_STR
d57b7160
VZ
120
121
c82c5274
VZ
122// the library names depend on the build, these macro builds the correct
123// library name for the given base name
d70fe85f
VZ
124#ifdef wxSUFFIX
125 #define wxSUFFIX_STR wxSTRINGIZE(wxSUFFIX)
126#else // suffix is empty
127 #define wxSUFFIX_STR ""
128#endif
c82c5274
VZ
129#define wxSHORT_VERSION_STRING \
130 wxSTRINGIZE(wxMAJOR_VERSION) wxSTRINGIZE(wxMINOR_VERSION)
d57b7160 131
c82c5274
VZ
132#define wxWX_LIB_NAME(name, subname) \
133 "wx" name wxSHORT_VERSION_STRING wxSUFFIX_STR subname
d57b7160 134
c82c5274 135#define wxBASE_LIB_NAME(name) wxWX_LIB_NAME("base", "_" name)
7d2295a0 136#define wxTOOLKIT_LIB_NAME(name) wxWX_LIB_NAME(wxSTRINGIZE(wxTOOLKIT_PREFIX), "_" name)
d57b7160 137
a47ad359 138// This one is for 3rd party libraries: they don't have the version number
c82c5274 139// in their names and usually exist in ANSI version only (except for regex)
a47ad359
VZ
140//
141// 3rd party libraries are also are not linked in when using DLLs as they're
142// embedded inside our own DLLs and don't need to be linked with the user code.
c82c5274 143#define wx3RD_PARTY_LIB_NAME(name) "wx" name wxSUFFIX_DEBUG
d57b7160 144
c82c5274
VZ
145// special version for regex as it does have a Unicode version
146#define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR
d57b7160 147
c82c5274 148#pragma comment(lib, wxWX_LIB_NAME("base", ""))
3fb26cf2 149
c82c5274
VZ
150#ifndef wxNO_NET_LIB
151 #pragma comment(lib, wxBASE_LIB_NAME("net"))
152#endif
153#ifndef wxNO_XML_LIB
154 #pragma comment(lib, wxBASE_LIB_NAME("xml"))
155#endif
a47ad359 156#if wxUSE_REGEX && !defined(wxNO_REGEX_LIB) && !defined(WXUSINGDLL)
c82c5274
VZ
157 #pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex"))
158#endif
159
160#if wxUSE_GUI
a47ad359 161 #if wxUSE_XML && !defined(wxNO_EXPAT_LIB) && !defined(WXUSINGDLL)
c82c5274 162 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat"))
3fb26cf2 163 #endif
a47ad359 164 #if wxUSE_LIBJPEG && !defined(wxNO_JPEG_LIB) && !defined(WXUSINGDLL)
c82c5274 165 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("jpeg"))
3fb26cf2 166 #endif
a47ad359 167 #if wxUSE_LIBPNG && !defined(wxNO_PNG_LIB) && !defined(WXUSINGDLL)
c82c5274
VZ
168 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("png"))
169 #endif
a47ad359 170 #if wxUSE_LIBTIFF && !defined(wxNO_TIFF_LIB) && !defined(WXUSINGDLL)
c82c5274
VZ
171 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff"))
172 #endif
a47ad359 173 #if wxUSE_ZLIB && !defined(wxNO_ZLIB_LIB) && !defined(WXUSINGDLL)
c82c5274 174 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("zlib"))
d57b7160
VZ
175 #endif
176
7d2295a0 177 #pragma comment(lib, wxTOOLKIT_LIB_NAME("core"))
c82c5274
VZ
178
179 #ifndef wxNO_ADV_LIB
7d2295a0 180 #pragma comment(lib, wxTOOLKIT_LIB_NAME("adv"))
c82c5274 181 #endif
e5099bdf 182
c82c5274 183 #ifndef wxNO_HTML_LIB
7d2295a0 184 #pragma comment(lib, wxTOOLKIT_LIB_NAME("html"))
c82c5274
VZ
185 #endif
186 #if wxUSE_GLCANVAS && !defined(wxNO_GL_LIB)
7d2295a0 187 #pragma comment(lib, wxTOOLKIT_LIB_NAME("gl"))
c82c5274
VZ
188 #endif
189 #if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB)
7d2295a0 190 #pragma comment(lib, wxTOOLKIT_LIB_NAME("qa"))
c82c5274
VZ
191 #endif
192 #if wxUSE_XRC && !defined(wxNO_XRC_LIB)
7d2295a0 193 #pragma comment(lib, wxTOOLKIT_LIB_NAME("xrc"))
c82c5274
VZ
194 #endif
195 #if wxUSE_AUI && !defined(wxNO_AUI_LIB)
7d2295a0 196 #pragma comment(lib, wxTOOLKIT_LIB_NAME("aui"))
c82c5274
VZ
197 #endif
198 #if wxUSE_PROPGRID && !defined(wxNO_PROPGRID_LIB)
7d2295a0 199 #pragma comment(lib, wxTOOLKIT_LIB_NAME("propgrid"))
c82c5274 200 #endif
77749ea9 201 #if wxUSE_RIBBON && !defined(wxNO_RIBBON_LIB)
7d2295a0 202 #pragma comment(lib, wxTOOLKIT_LIB_NAME("ribbon"))
77749ea9 203 #endif
c82c5274 204 #if wxUSE_RICHTEXT && !defined(wxNO_RICHTEXT_LIB)
7d2295a0 205 #pragma comment(lib, wxTOOLKIT_LIB_NAME("richtext"))
c82c5274
VZ
206 #endif
207 #if wxUSE_MEDIACTRL && !defined(wxNO_MEDIA_LIB)
7d2295a0 208 #pragma comment(lib, wxTOOLKIT_LIB_NAME("media"))
c82c5274
VZ
209 #endif
210 #if wxUSE_STC && !defined(wxNO_STC_LIB)
7d2295a0 211 #pragma comment(lib, wxTOOLKIT_LIB_NAME("stc"))
a47ad359
VZ
212 #ifndef WXUSINGDLL
213 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("scintilla"))
214 #endif
c82c5274 215 #endif
c0feacc8
VZ
216 #if wxUSE_WEBVIEW && !defined(wxNO_WEBVIEW_LIB)
217 #pragma comment(lib, wxTOOLKIT_LIB_NAME("webview"))
218 #endif
c82c5274 219#endif // wxUSE_GUI
a9d41efb
VS
220
221
222#ifndef WXUSINGDLL
223 // Make sure all required system libraries are added to the linker too when
224 // using static libraries.
225 #pragma comment(lib, "kernel32")
226 #pragma comment(lib, "user32")
227 #pragma comment(lib, "gdi32")
228 #pragma comment(lib, "comdlg32")
229 #pragma comment(lib, "winspool")
230 #pragma comment(lib, "winmm")
231 #pragma comment(lib, "shell32")
232 #pragma comment(lib, "comctl32")
233 #pragma comment(lib, "ole32")
234 #pragma comment(lib, "oleaut32")
235 #pragma comment(lib, "uuid")
236 #pragma comment(lib, "rpcrt4")
237 #pragma comment(lib, "advapi32")
238 #pragma comment(lib, "wsock32")
239 #if wxUSE_URL_NATIVE
240 #pragma comment(lib, "wininet")
241 #endif
d48f13a1
VZ
242
243 #ifdef __WXGTK__
244 #pragma comment(lib, "gtk-win32-2.0.lib")
245 #pragma comment(lib, "gdk-win32-2.0.lib")
246 #pragma comment(lib, "pangocairo-1.0.lib")
247 #pragma comment(lib, "gdk_pixbuf-2.0.lib")
248 #pragma comment(lib, "cairo.lib")
249 #pragma comment(lib, "pango-1.0.lib")
250 #pragma comment(lib, "gobject-2.0.lib")
251 #pragma comment(lib, "gthread-2.0.lib")
252 #pragma comment(lib, "glib-2.0.lib")
253 #endif
a9d41efb 254#endif // !WXUSINGDLL