]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: msvc/wx/setup.h | |
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 | // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _MSC_VER | |
12 | #error "This file should only be included when using Microsoft Visual C++" | |
13 | #endif | |
14 | ||
15 | // VC++ IDE predefines _DEBUG and _UNICODE for the new projects itself, but | |
16 | // the other symbols (WXUSINGDLL, __WXUNIVERSAL__, ...) should be defined | |
17 | // explicitly! | |
18 | ||
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 | |
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 | |
39 | #endif // _UNICODE/!_UNICODE | |
40 | #endif | |
41 | ||
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 | |
48 | #define wxCOMPILER_PREFIX wxCONCAT(vc, wxMSVC_VERSION) | |
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 | |
62 | #elif _MSC_VER == 1700 | |
63 | #define wxCOMPILER_PREFIX vc110 | |
64 | #elif _MSC_VER == 1800 | |
65 | #define wxCOMPILER_PREFIX vc120 | |
66 | #else | |
67 | #error "Unknown MSVC compiler version, please report to wx-dev." | |
68 | #endif | |
69 | #else | |
70 | #define wxCOMPILER_PREFIX vc | |
71 | #endif | |
72 | ||
73 | // architecture-specific part: not used (again, for compatibility), for x86 | |
74 | #if defined(_M_X64) | |
75 | #define wxARCH_SUFFIX _x64 | |
76 | #elif defined(_M_IA64) | |
77 | #define wxARCH_SUFFIX _ia64 | |
78 | #else // assume _M_IX86 | |
79 | #define wxARCH_SUFFIX | |
80 | #endif | |
81 | ||
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 | |
89 | #ifdef WXUSINGDLL | |
90 | #define wxLIB_SUBDIR \ | |
91 | wxCONCAT4(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _dll, wxCFG) | |
92 | #else // !DLL | |
93 | #define wxLIB_SUBDIR \ | |
94 | wxCONCAT4(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _lib, wxCFG) | |
95 | #endif // DLL/!DLL | |
96 | ||
97 | // The user can predefine a different prefix if not using the default MSW port | |
98 | // with MSVC. | |
99 | #ifndef wxTOOLKIT_PREFIX | |
100 | #if defined(__WXGTK__) | |
101 | #define wxTOOLKIT_PREFIX gtk2 | |
102 | #else | |
103 | #define wxTOOLKIT_PREFIX msw | |
104 | #endif | |
105 | #endif // wxTOOLKIT_PREFIX | |
106 | ||
107 | // the real setup.h header file we need is in the build-specific directory, | |
108 | // construct the path to it | |
109 | #ifdef wxSUFFIX | |
110 | #define wxSETUPH_PATH \ | |
111 | wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h) | |
112 | #else // suffix is empty | |
113 | #define wxSETUPH_PATH \ | |
114 | wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, /wx/setup.h) | |
115 | #endif | |
116 | ||
117 | #define wxSETUPH_PATH_STR wxSTRINGIZE(wxSETUPH_PATH) | |
118 | ||
119 | #include wxSETUPH_PATH_STR | |
120 | ||
121 | ||
122 | // the library names depend on the build, these macro builds the correct | |
123 | // library name for the given base name | |
124 | #ifdef wxSUFFIX | |
125 | #define wxSUFFIX_STR wxSTRINGIZE(wxSUFFIX) | |
126 | #else // suffix is empty | |
127 | #define wxSUFFIX_STR "" | |
128 | #endif | |
129 | #define wxSHORT_VERSION_STRING \ | |
130 | wxSTRINGIZE(wxMAJOR_VERSION) wxSTRINGIZE(wxMINOR_VERSION) | |
131 | ||
132 | #define wxWX_LIB_NAME(name, subname) \ | |
133 | "wx" name wxSHORT_VERSION_STRING wxSUFFIX_STR subname | |
134 | ||
135 | #define wxBASE_LIB_NAME(name) wxWX_LIB_NAME("base", "_" name) | |
136 | #define wxTOOLKIT_LIB_NAME(name) wxWX_LIB_NAME(wxSTRINGIZE(wxTOOLKIT_PREFIX), "_" name) | |
137 | ||
138 | // This one is for 3rd party libraries: they don't have the version number | |
139 | // in their names and usually exist in ANSI version only (except for regex) | |
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. | |
143 | #define wx3RD_PARTY_LIB_NAME(name) "wx" name wxSUFFIX_DEBUG | |
144 | ||
145 | // special version for regex as it does have a Unicode version | |
146 | #define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR | |
147 | ||
148 | #pragma comment(lib, wxWX_LIB_NAME("base", "")) | |
149 | ||
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 | |
156 | #if wxUSE_REGEX && !defined(wxNO_REGEX_LIB) && !defined(WXUSINGDLL) | |
157 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex")) | |
158 | #endif | |
159 | ||
160 | #if wxUSE_GUI | |
161 | #if wxUSE_XML && !defined(wxNO_EXPAT_LIB) && !defined(WXUSINGDLL) | |
162 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat")) | |
163 | #endif | |
164 | #if wxUSE_LIBJPEG && !defined(wxNO_JPEG_LIB) && !defined(WXUSINGDLL) | |
165 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("jpeg")) | |
166 | #endif | |
167 | #if wxUSE_LIBPNG && !defined(wxNO_PNG_LIB) && !defined(WXUSINGDLL) | |
168 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("png")) | |
169 | #endif | |
170 | #if wxUSE_LIBTIFF && !defined(wxNO_TIFF_LIB) && !defined(WXUSINGDLL) | |
171 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff")) | |
172 | #endif | |
173 | #if wxUSE_ZLIB && !defined(wxNO_ZLIB_LIB) && !defined(WXUSINGDLL) | |
174 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("zlib")) | |
175 | #endif | |
176 | ||
177 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("core")) | |
178 | ||
179 | #ifndef wxNO_ADV_LIB | |
180 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("adv")) | |
181 | #endif | |
182 | ||
183 | #ifndef wxNO_HTML_LIB | |
184 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("html")) | |
185 | #endif | |
186 | #if wxUSE_GLCANVAS && !defined(wxNO_GL_LIB) | |
187 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("gl")) | |
188 | #endif | |
189 | #if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB) | |
190 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("qa")) | |
191 | #endif | |
192 | #if wxUSE_XRC && !defined(wxNO_XRC_LIB) | |
193 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("xrc")) | |
194 | #endif | |
195 | #if wxUSE_AUI && !defined(wxNO_AUI_LIB) | |
196 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("aui")) | |
197 | #endif | |
198 | #if wxUSE_PROPGRID && !defined(wxNO_PROPGRID_LIB) | |
199 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("propgrid")) | |
200 | #endif | |
201 | #if wxUSE_RIBBON && !defined(wxNO_RIBBON_LIB) | |
202 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("ribbon")) | |
203 | #endif | |
204 | #if wxUSE_RICHTEXT && !defined(wxNO_RICHTEXT_LIB) | |
205 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("richtext")) | |
206 | #endif | |
207 | #if wxUSE_MEDIACTRL && !defined(wxNO_MEDIA_LIB) | |
208 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("media")) | |
209 | #endif | |
210 | #if wxUSE_STC && !defined(wxNO_STC_LIB) | |
211 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("stc")) | |
212 | #ifndef WXUSINGDLL | |
213 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("scintilla")) | |
214 | #endif | |
215 | #endif | |
216 | #if wxUSE_WEBVIEW && !defined(wxNO_WEBVIEW_LIB) | |
217 | #pragma comment(lib, wxTOOLKIT_LIB_NAME("webview")) | |
218 | #endif | |
219 | #endif // wxUSE_GUI | |
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 | |
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 | |
254 | #endif // !WXUSINGDLL |