Remove all lines containing cvs/svn "$Id$" keyword.
[wxWidgets.git] / include / msvc / wx / setup.h
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 #ifdef WXUSINGDLL
83 #define wxLIB_SUBDIR wxCONCAT3(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _dll)
84 #else // !DLL
85 #define wxLIB_SUBDIR wxCONCAT3(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _lib)
86 #endif // DLL/!DLL
87
88 // The user can predefine a different prefix if not using the default MSW port
89 // with MSVC.
90 #ifndef wxTOOLKIT_PREFIX
91 #if defined(__WXGTK__)
92 #define wxTOOLKIT_PREFIX gtk2
93 #else
94 #define wxTOOLKIT_PREFIX msw
95 #endif
96 #endif // wxTOOLKIT_PREFIX
97
98 // the real setup.h header file we need is in the build-specific directory,
99 // construct the path to it
100 #ifdef wxSUFFIX
101 #define wxSETUPH_PATH \
102 wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)
103 #else // suffix is empty
104 #define wxSETUPH_PATH \
105 wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, /wx/setup.h)
106 #endif
107
108 #define wxSETUPH_PATH_STR wxSTRINGIZE(wxSETUPH_PATH)
109
110 #include wxSETUPH_PATH_STR
111
112
113 // the library names depend on the build, these macro builds the correct
114 // library name for the given base name
115 #ifdef wxSUFFIX
116 #define wxSUFFIX_STR wxSTRINGIZE(wxSUFFIX)
117 #else // suffix is empty
118 #define wxSUFFIX_STR ""
119 #endif
120 #define wxSHORT_VERSION_STRING \
121 wxSTRINGIZE(wxMAJOR_VERSION) wxSTRINGIZE(wxMINOR_VERSION)
122
123 #define wxWX_LIB_NAME(name, subname) \
124 "wx" name wxSHORT_VERSION_STRING wxSUFFIX_STR subname
125
126 #define wxBASE_LIB_NAME(name) wxWX_LIB_NAME("base", "_" name)
127 #define wxTOOLKIT_LIB_NAME(name) wxWX_LIB_NAME(wxSTRINGIZE(wxTOOLKIT_PREFIX), "_" name)
128
129 // This one is for 3rd party libraries: they don't have the version number
130 // in their names and usually exist in ANSI version only (except for regex)
131 //
132 // 3rd party libraries are also are not linked in when using DLLs as they're
133 // embedded inside our own DLLs and don't need to be linked with the user code.
134 #define wx3RD_PARTY_LIB_NAME(name) "wx" name wxSUFFIX_DEBUG
135
136 // special version for regex as it does have a Unicode version
137 #define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR
138
139 #pragma comment(lib, wxWX_LIB_NAME("base", ""))
140
141 #ifndef wxNO_NET_LIB
142 #pragma comment(lib, wxBASE_LIB_NAME("net"))
143 #endif
144 #ifndef wxNO_XML_LIB
145 #pragma comment(lib, wxBASE_LIB_NAME("xml"))
146 #endif
147 #if wxUSE_REGEX && !defined(wxNO_REGEX_LIB) && !defined(WXUSINGDLL)
148 #pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex"))
149 #endif
150
151 #if wxUSE_GUI
152 #if wxUSE_XML && !defined(wxNO_EXPAT_LIB) && !defined(WXUSINGDLL)
153 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat"))
154 #endif
155 #if wxUSE_LIBJPEG && !defined(wxNO_JPEG_LIB) && !defined(WXUSINGDLL)
156 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("jpeg"))
157 #endif
158 #if wxUSE_LIBPNG && !defined(wxNO_PNG_LIB) && !defined(WXUSINGDLL)
159 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("png"))
160 #endif
161 #if wxUSE_LIBTIFF && !defined(wxNO_TIFF_LIB) && !defined(WXUSINGDLL)
162 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff"))
163 #endif
164 #if wxUSE_ZLIB && !defined(wxNO_ZLIB_LIB) && !defined(WXUSINGDLL)
165 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("zlib"))
166 #endif
167
168 #pragma comment(lib, wxTOOLKIT_LIB_NAME("core"))
169
170 #ifndef wxNO_ADV_LIB
171 #pragma comment(lib, wxTOOLKIT_LIB_NAME("adv"))
172 #endif
173
174 #ifndef wxNO_HTML_LIB
175 #pragma comment(lib, wxTOOLKIT_LIB_NAME("html"))
176 #endif
177 #if wxUSE_GLCANVAS && !defined(wxNO_GL_LIB)
178 #pragma comment(lib, wxTOOLKIT_LIB_NAME("gl"))
179 #endif
180 #if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB)
181 #pragma comment(lib, wxTOOLKIT_LIB_NAME("qa"))
182 #endif
183 #if wxUSE_XRC && !defined(wxNO_XRC_LIB)
184 #pragma comment(lib, wxTOOLKIT_LIB_NAME("xrc"))
185 #endif
186 #if wxUSE_AUI && !defined(wxNO_AUI_LIB)
187 #pragma comment(lib, wxTOOLKIT_LIB_NAME("aui"))
188 #endif
189 #if wxUSE_PROPGRID && !defined(wxNO_PROPGRID_LIB)
190 #pragma comment(lib, wxTOOLKIT_LIB_NAME("propgrid"))
191 #endif
192 #if wxUSE_RIBBON && !defined(wxNO_RIBBON_LIB)
193 #pragma comment(lib, wxTOOLKIT_LIB_NAME("ribbon"))
194 #endif
195 #if wxUSE_RICHTEXT && !defined(wxNO_RICHTEXT_LIB)
196 #pragma comment(lib, wxTOOLKIT_LIB_NAME("richtext"))
197 #endif
198 #if wxUSE_MEDIACTRL && !defined(wxNO_MEDIA_LIB)
199 #pragma comment(lib, wxTOOLKIT_LIB_NAME("media"))
200 #endif
201 #if wxUSE_STC && !defined(wxNO_STC_LIB)
202 #pragma comment(lib, wxTOOLKIT_LIB_NAME("stc"))
203 #ifndef WXUSINGDLL
204 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("scintilla"))
205 #endif
206 #endif
207 #if wxUSE_WEBVIEW && !defined(wxNO_WEBVIEW_LIB)
208 #pragma comment(lib, wxTOOLKIT_LIB_NAME("webview"))
209 #endif
210 #endif // wxUSE_GUI
211
212
213 #ifndef WXUSINGDLL
214 // Make sure all required system libraries are added to the linker too when
215 // using static libraries.
216 #pragma comment(lib, "kernel32")
217 #pragma comment(lib, "user32")
218 #pragma comment(lib, "gdi32")
219 #pragma comment(lib, "comdlg32")
220 #pragma comment(lib, "winspool")
221 #pragma comment(lib, "winmm")
222 #pragma comment(lib, "shell32")
223 #pragma comment(lib, "comctl32")
224 #pragma comment(lib, "ole32")
225 #pragma comment(lib, "oleaut32")
226 #pragma comment(lib, "uuid")
227 #pragma comment(lib, "rpcrt4")
228 #pragma comment(lib, "advapi32")
229 #pragma comment(lib, "wsock32")
230 #if wxUSE_URL_NATIVE
231 #pragma comment(lib, "wininet")
232 #endif
233
234 #ifdef __WXGTK__
235 #pragma comment(lib, "gtk-win32-2.0.lib")
236 #pragma comment(lib, "gdk-win32-2.0.lib")
237 #pragma comment(lib, "pangocairo-1.0.lib")
238 #pragma comment(lib, "gdk_pixbuf-2.0.lib")
239 #pragma comment(lib, "cairo.lib")
240 #pragma comment(lib, "pango-1.0.lib")
241 #pragma comment(lib, "gobject-2.0.lib")
242 #pragma comment(lib, "gthread-2.0.lib")
243 #pragma comment(lib, "glib-2.0.lib")
244 #endif
245 #endif // !WXUSINGDLL