]>
git.saurik.com Git - wxWidgets.git/blob - 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
7 // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #error "This file should only be included when using Microsoft Visual C++"
15 // VC++ IDE predefines _DEBUG and _UNICODE for the new projects itself, but
16 // the other symbols (WXUSINGDLL, __WXUNIVERSAL__, ...) should be defined
19 #include "wx/version.h"
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
26 #define wxSUFFIX_DEBUG "d"
31 #endif // _UNICODE/!_UNICODE
33 #define wxSUFFIX_DEBUG ""
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
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
48 #define wxCOMPILER_PREFIX wxCONCAT(vc, wxMSVC_VERSION)
49 #elif defined(wxMSVC_VERSION_AUTO)
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
67 #error "Unknown MSVC compiler version, please report to wx-dev."
70 #define wxCOMPILER_PREFIX vc
73 // architecture-specific part: not used (again, for compatibility), for x86
75 #define wxARCH_SUFFIX _x64
76 #elif defined(_M_IA64)
77 #define wxARCH_SUFFIX _ia64
78 #else // assume _M_IX86
82 // Ensure the library configuration is defined
87 // Construct the path for the subdirectory under /lib/ that the included setup.h
90 #define wxLIB_SUBDIR \
91 wxCONCAT4(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _dll, wxCFG)
93 #define wxLIB_SUBDIR \
94 wxCONCAT4(wxCOMPILER_PREFIX, wxARCH_SUFFIX, _lib, wxCFG)
97 // The user can predefine a different prefix if not using the default MSW port
99 #ifndef wxTOOLKIT_PREFIX
100 #if defined(__WXGTK__)
101 #define wxTOOLKIT_PREFIX gtk2
103 #define wxTOOLKIT_PREFIX msw
105 #endif // wxTOOLKIT_PREFIX
107 // the real setup.h header file we need is in the build-specific directory,
108 // construct the path to it
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)
117 #define wxSETUPH_PATH_STR wxSTRINGIZE(wxSETUPH_PATH)
119 #include wxSETUPH_PATH_STR
122 // the library names depend on the build, these macro builds the correct
123 // library name for the given base name
125 #define wxSUFFIX_STR wxSTRINGIZE(wxSUFFIX)
126 #else // suffix is empty
127 #define wxSUFFIX_STR ""
129 #define wxSHORT_VERSION_STRING \
130 wxSTRINGIZE(wxMAJOR_VERSION) wxSTRINGIZE(wxMINOR_VERSION)
132 #define wxWX_LIB_NAME(name, subname) \
133 "wx" name wxSHORT_VERSION_STRING wxSUFFIX_STR subname
135 #define wxBASE_LIB_NAME(name) wxWX_LIB_NAME("base", "_" name)
136 #define wxTOOLKIT_LIB_NAME(name) wxWX_LIB_NAME(wxSTRINGIZE(wxTOOLKIT_PREFIX), "_" name)
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)
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
145 // special version for regex as it does have a Unicode version
146 #define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR
148 #pragma comment(lib, wxWX_LIB_NAME("base", ""))
151 #pragma comment(lib, wxBASE_LIB_NAME("net"))
154 #pragma comment(lib, wxBASE_LIB_NAME("xml"))
156 #if wxUSE_REGEX && !defined(wxNO_REGEX_LIB) && !defined(WXUSINGDLL)
157 #pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex"))
161 #if wxUSE_XML && !defined(wxNO_EXPAT_LIB) && !defined(WXUSINGDLL)
162 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat"))
164 #if wxUSE_LIBJPEG && !defined(wxNO_JPEG_LIB) && !defined(WXUSINGDLL)
165 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("jpeg"))
167 #if wxUSE_LIBPNG && !defined(wxNO_PNG_LIB) && !defined(WXUSINGDLL)
168 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("png"))
170 #if wxUSE_LIBTIFF && !defined(wxNO_TIFF_LIB) && !defined(WXUSINGDLL)
171 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff"))
173 #if wxUSE_ZLIB && !defined(wxNO_ZLIB_LIB) && !defined(WXUSINGDLL)
174 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("zlib"))
177 #pragma comment(lib, wxTOOLKIT_LIB_NAME("core"))
180 #pragma comment(lib, wxTOOLKIT_LIB_NAME("adv"))
183 #ifndef wxNO_HTML_LIB
184 #pragma comment(lib, wxTOOLKIT_LIB_NAME("html"))
186 #if wxUSE_GLCANVAS && !defined(wxNO_GL_LIB)
187 #pragma comment(lib, wxTOOLKIT_LIB_NAME("gl"))
189 #if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB)
190 #pragma comment(lib, wxTOOLKIT_LIB_NAME("qa"))
192 #if wxUSE_XRC && !defined(wxNO_XRC_LIB)
193 #pragma comment(lib, wxTOOLKIT_LIB_NAME("xrc"))
195 #if wxUSE_AUI && !defined(wxNO_AUI_LIB)
196 #pragma comment(lib, wxTOOLKIT_LIB_NAME("aui"))
198 #if wxUSE_PROPGRID && !defined(wxNO_PROPGRID_LIB)
199 #pragma comment(lib, wxTOOLKIT_LIB_NAME("propgrid"))
201 #if wxUSE_RIBBON && !defined(wxNO_RIBBON_LIB)
202 #pragma comment(lib, wxTOOLKIT_LIB_NAME("ribbon"))
204 #if wxUSE_RICHTEXT && !defined(wxNO_RICHTEXT_LIB)
205 #pragma comment(lib, wxTOOLKIT_LIB_NAME("richtext"))
207 #if wxUSE_MEDIACTRL && !defined(wxNO_MEDIA_LIB)
208 #pragma comment(lib, wxTOOLKIT_LIB_NAME("media"))
210 #if wxUSE_STC && !defined(wxNO_STC_LIB)
211 #pragma comment(lib, wxTOOLKIT_LIB_NAME("stc"))
213 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("scintilla"))
216 #if wxUSE_WEBVIEW && !defined(wxNO_WEBVIEW_LIB)
217 #pragma comment(lib, wxTOOLKIT_LIB_NAME("webview"))
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")
240 #pragma comment(lib, "wininet")
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")
254 #endif // !WXUSINGDLL