]>
Commit | Line | Data |
---|---|---|
e5099bdf VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: msvc/wx/msw/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 | // 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 | |
38 | #define wxSUFFIX | |
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 | |
48 | #define wxCOMPILER_PREFIX wxCONCAT2(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 | #else | |
63 | #error "Unknown MSVC compiler version, please report to wx-dev." | |
64 | #endif | |
65 | #else | |
66 | #define wxCOMPILER_PREFIX vc | |
67 | #endif | |
d48a4705 VZ |
68 | |
69 | // architecture-specific part: not used (again, for compatibility), for x86 | |
70 | #if defined(_M_X64) | |
71 | #define wxARCH_SUFFIX _amd64 | |
72 | #elif defined(_M_IA64) | |
73 | #define wxARCH_SUFFIX _ia64 | |
74 | #else // assume _M_IX86 | |
75 | #define wxARCH_SUFFIX | |
76 | #endif | |
77 | ||
c82c5274 | 78 | #ifdef WXUSINGDLL |
d48a4705 | 79 | #define wxLIB_SUBDIR wxCONCAT3(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _dll) |
c82c5274 | 80 | #else // !DLL |
d48a4705 | 81 | #define wxLIB_SUBDIR wxCONCAT3(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _lib) |
c82c5274 | 82 | #endif // DLL/!DLL |
d57b7160 VZ |
83 | |
84 | ||
c82c5274 VZ |
85 | // the real setup.h header file we need is in the build-specific directory, |
86 | // construct the path to it | |
87 | #define wxSETUPH_PATH \ | |
88 | wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /msw, wxSUFFIX, /wx/setup.h) | |
89 | #define wxSETUPH_PATH_STR wxSTRINGIZE(wxSETUPH_PATH) | |
d57b7160 | 90 | |
c82c5274 | 91 | #include wxSETUPH_PATH_STR |
d57b7160 VZ |
92 | |
93 | ||
c82c5274 VZ |
94 | // the library names depend on the build, these macro builds the correct |
95 | // library name for the given base name | |
96 | #define wxSUFFIX_STR wxSTRINGIZE(wxSUFFIX) | |
97 | #define wxSHORT_VERSION_STRING \ | |
98 | wxSTRINGIZE(wxMAJOR_VERSION) wxSTRINGIZE(wxMINOR_VERSION) | |
d57b7160 | 99 | |
c82c5274 VZ |
100 | #define wxWX_LIB_NAME(name, subname) \ |
101 | "wx" name wxSHORT_VERSION_STRING wxSUFFIX_STR subname | |
d57b7160 | 102 | |
c82c5274 VZ |
103 | #define wxBASE_LIB_NAME(name) wxWX_LIB_NAME("base", "_" name) |
104 | #define wxMSW_LIB_NAME(name) wxWX_LIB_NAME("msw", "_" name) | |
d57b7160 | 105 | |
c82c5274 VZ |
106 | // this one is for 3rd party libraries: they don't have the version number |
107 | // in their names and usually exist in ANSI version only (except for regex) | |
108 | #define wx3RD_PARTY_LIB_NAME(name) "wx" name wxSUFFIX_DEBUG | |
d57b7160 | 109 | |
c82c5274 VZ |
110 | // special version for regex as it does have a Unicode version |
111 | #define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR | |
d57b7160 | 112 | |
c82c5274 | 113 | #pragma comment(lib, wxWX_LIB_NAME("base", "")) |
3fb26cf2 | 114 | |
c82c5274 VZ |
115 | #ifndef wxNO_NET_LIB |
116 | #pragma comment(lib, wxBASE_LIB_NAME("net")) | |
117 | #endif | |
118 | #ifndef wxNO_XML_LIB | |
119 | #pragma comment(lib, wxBASE_LIB_NAME("xml")) | |
120 | #endif | |
121 | #if wxUSE_REGEX && !defined(wxNO_REGEX_LIB) | |
122 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex")) | |
123 | #endif | |
124 | ||
125 | #if wxUSE_GUI | |
126 | #if wxUSE_XML && !defined(wxNO_EXPAT_LIB) | |
127 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat")) | |
3fb26cf2 | 128 | #endif |
c82c5274 VZ |
129 | #if wxUSE_LIBJPEG && !defined(wxNO_JPEG_LIB) |
130 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("jpeg")) | |
3fb26cf2 | 131 | #endif |
c82c5274 VZ |
132 | #if wxUSE_LIBPNG && !defined(wxNO_PNG_LIB) |
133 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("png")) | |
134 | #endif | |
135 | #if wxUSE_LIBTIFF && !defined(wxNO_TIFF_LIB) | |
136 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff")) | |
137 | #endif | |
138 | #if wxUSE_ZLIB && !defined(wxNO_ZLIB_LIB) | |
139 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("zlib")) | |
d57b7160 VZ |
140 | #endif |
141 | ||
c82c5274 VZ |
142 | #pragma comment(lib, wxMSW_LIB_NAME("core")) |
143 | ||
144 | #ifndef wxNO_ADV_LIB | |
145 | #pragma comment(lib, wxMSW_LIB_NAME("adv")) | |
146 | #endif | |
e5099bdf | 147 | |
c82c5274 VZ |
148 | #ifndef wxNO_HTML_LIB |
149 | #pragma comment(lib, wxMSW_LIB_NAME("html")) | |
150 | #endif | |
151 | #if wxUSE_GLCANVAS && !defined(wxNO_GL_LIB) | |
152 | #pragma comment(lib, wxMSW_LIB_NAME("gl")) | |
153 | #endif | |
154 | #if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB) | |
155 | #pragma comment(lib, wxMSW_LIB_NAME("qa")) | |
156 | #endif | |
157 | #if wxUSE_XRC && !defined(wxNO_XRC_LIB) | |
158 | #pragma comment(lib, wxMSW_LIB_NAME("xrc")) | |
159 | #endif | |
160 | #if wxUSE_AUI && !defined(wxNO_AUI_LIB) | |
161 | #pragma comment(lib, wxMSW_LIB_NAME("aui")) | |
162 | #endif | |
163 | #if wxUSE_PROPGRID && !defined(wxNO_PROPGRID_LIB) | |
164 | #pragma comment(lib, wxMSW_LIB_NAME("propgrid")) | |
165 | #endif | |
77749ea9 PC |
166 | #if wxUSE_RIBBON && !defined(wxNO_RIBBON_LIB) |
167 | #pragma comment(lib, wxMSW_LIB_NAME("ribbon")) | |
168 | #endif | |
c82c5274 VZ |
169 | #if wxUSE_RICHTEXT && !defined(wxNO_RICHTEXT_LIB) |
170 | #pragma comment(lib, wxMSW_LIB_NAME("richtext")) | |
171 | #endif | |
172 | #if wxUSE_MEDIACTRL && !defined(wxNO_MEDIA_LIB) | |
173 | #pragma comment(lib, wxMSW_LIB_NAME("media")) | |
174 | #endif | |
175 | #if wxUSE_STC && !defined(wxNO_STC_LIB) | |
176 | #pragma comment(lib, wxMSW_LIB_NAME("stc")) | |
177 | #pragma comment(lib, wx3RD_PARTY_LIB_NAME("scintilla")) | |
178 | #endif | |
179 | #endif // wxUSE_GUI |