Fix automatic linking with MSVC for monolithic builds

MSVC users can simplify their projects by prepending
$(WXWIN)\include\msvc to the compiler include directories, which results
in automatic including the build-specific setup.h and linking all
required wxWidgets and system libraries.

This worked only for the default multilib builds but not for monolithic
builds where wxWidgets libraries are created and named differently.

This patch allows the users (by defining wxMONOLITHIC=1 in their
project) to use it also for monolithic builds.
This commit is contained in:
PB
2018-05-05 10:16:08 +02:00
committed by Vadim Zeitlin
parent 2e8516c5fe
commit 46ba9ca2f9

View File

@@ -149,20 +149,27 @@
// special version for regex as it does have a Unicode version // special version for regex as it does have a Unicode version
#define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR #define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR
#pragma comment(lib, wxWX_LIB_NAME("base", "")) #if defined(wxMONOLITHIC) && wxMONOLITHIC == 1
#pragma comment(lib, wxWX_LIB_NAME("msw", ""))
#else
#pragma comment(lib, wxWX_LIB_NAME("base", ""))
#ifndef wxNO_NET_LIB #ifndef wxNO_NET_LIB
#ifndef WXUSINGDLL
#pragma comment(lib, "wsock32")
#endif
#pragma comment(lib, wxBASE_LIB_NAME("net")) #pragma comment(lib, wxBASE_LIB_NAME("net"))
#endif
#if wxUSE_XML && !defined(wxNO_XML_LIB)
#pragma comment(lib, wxBASE_LIB_NAME("xml"))
#if !defined(wxNO_EXPAT_LIB) && !defined(WXUSINGDLL)
#pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat"))
#endif #endif
#if wxUSE_XML && !defined(wxNO_XML_LIB)
#pragma comment(lib, wxBASE_LIB_NAME("xml"))
#endif
#endif // defined(wxMONOLITHIC) && wxMONOLITHIC == 1
#if !defined(wxNO_NET_LIB) && !defined(WXUSINGDLL)
#pragma comment(lib, "wsock32")
#endif #endif
#if wxUSE_XML && !defined(wxNO_XML_LIB) && !defined(wxNO_EXPAT_LIB) && !defined(WXUSINGDLL)
#pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat"))
#endif
#if wxUSE_REGEX && !defined(wxNO_REGEX_LIB) && !defined(WXUSINGDLL) #if wxUSE_REGEX && !defined(wxNO_REGEX_LIB) && !defined(WXUSINGDLL)
#pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex")) #pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex"))
#endif #endif
@@ -181,6 +188,8 @@
#pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff")) #pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff"))
#endif #endif
#if !defined(wxMONOLITHIC) || wxMONOLITHIC == 0
#pragma comment(lib, wxTOOLKIT_LIB_NAME("core")) #pragma comment(lib, wxTOOLKIT_LIB_NAME("core"))
#ifndef wxNO_ADV_LIB #ifndef wxNO_ADV_LIB
@@ -190,9 +199,6 @@
#if wxUSE_HTML && !defined(wxNO_HTML_LIB) #if wxUSE_HTML && !defined(wxNO_HTML_LIB)
#pragma comment(lib, wxTOOLKIT_LIB_NAME("html")) #pragma comment(lib, wxTOOLKIT_LIB_NAME("html"))
#endif #endif
#if wxUSE_GLCANVAS && !defined(wxNO_GL_LIB)
#pragma comment(lib, wxTOOLKIT_LIB_NAME("gl"))
#endif
#if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB) #if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB)
#pragma comment(lib, wxTOOLKIT_LIB_NAME("qa")) #pragma comment(lib, wxTOOLKIT_LIB_NAME("qa"))
#endif #endif
@@ -216,13 +222,20 @@
#endif #endif
#if wxUSE_STC && !defined(wxNO_STC_LIB) #if wxUSE_STC && !defined(wxNO_STC_LIB)
#pragma comment(lib, wxTOOLKIT_LIB_NAME("stc")) #pragma comment(lib, wxTOOLKIT_LIB_NAME("stc"))
#ifndef WXUSINGDLL
#pragma comment(lib, wx3RD_PARTY_LIB_NAME("scintilla"))
#endif
#endif #endif
#if wxUSE_WEBVIEW && !defined(wxNO_WEBVIEW_LIB) #if wxUSE_WEBVIEW && !defined(wxNO_WEBVIEW_LIB)
#pragma comment(lib, wxTOOLKIT_LIB_NAME("webview")) #pragma comment(lib, wxTOOLKIT_LIB_NAME("webview"))
#endif #endif
#endif // !defined(wxMONOLITHIC) || wxMONOLITHIC == 0
#if wxUSE_GLCANVAS && !defined(wxNO_GL_LIB)
#pragma comment(lib, wxTOOLKIT_LIB_NAME("gl"))
#endif
#if wxUSE_STC && !defined(wxNO_STC_LIB) && !defined(WXUSINGDLL)
#pragma comment(lib, wx3RD_PARTY_LIB_NAME("scintilla"))
#endif
#endif // wxUSE_GUI #endif // wxUSE_GUI