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