Fix wxGTK/Win32 CMake build.

See https://github.com/wxWidgets/wxWidgets/pull/750

Closes #18093.
This commit is contained in:
Vadim Zeitlin
2018-03-31 01:41:15 +02:00
5 changed files with 41 additions and 5 deletions

View File

@@ -202,8 +202,8 @@ function(wx_set_target_properties target_name is_base)
PUBLIC ${wxTOOLKIT_INCLUDE_DIRS})
endif()
if (WXMSW)
set(WXMSW_LIBRARIES
if (WIN32)
set(WIN32_LIBRARIES
kernel32
user32
gdi32
@@ -225,7 +225,7 @@ function(wx_set_target_properties target_name is_base)
uxtheme
)
target_link_libraries(${target_name}
PUBLIC ${WXMSW_LIBRARIES})
PUBLIC ${WIN32_LIBRARIES})
endif()
if(wxTOOLKIT_LIBRARIES)

View File

@@ -20,6 +20,9 @@ elseif(WXOSX_COCOA)
elseif(WXGTK)
wx_append_sources(ADV_FILES ADVANCED_GTK2)
wx_append_sources(ADV_FILES ADVANCED_GTK_NATIVE)
if(WIN32)
wx_append_sources(ADV_FILES ADVANCED_GTK_WIN32)
endif()
endif()
if(UNIX AND NOT APPLE AND NOT WIN32)

View File

@@ -28,7 +28,11 @@ elseif(WXGTK)
wx_append_sources(CORE_SRC GTK2_LOWLEVEL)
wx_append_sources(CORE_SRC GTK2)
wx_append_sources(CORE_SRC XWIN_LOWLEVEL)
if(UNIX)
wx_append_sources(CORE_SRC XWIN_LOWLEVEL)
elseif(WIN32)
wx_append_sources(CORE_SRC GTK_WIN32)
endif()
elseif(WXOSX_COCOA)
wx_append_sources(CORE_SRC BASE_AND_GUI_OSX_COCOA)
wx_append_sources(CORE_SRC OSX_LOWLEVEL)

View File

@@ -342,7 +342,7 @@ wx_option(wxUSE_HOTKEY "use wxWindow::RegisterHotKey()")
wx_option(wxUSE_JOYSTICK "use wxJoystick")
wx_option(wxUSE_METAFILE "use wxMetaFile")
wx_option(wxUSE_DRAGIMAGE "use wxDragImage")
if(WIN32)
if(WXMSW)
wx_option(wxUSE_ACCESSIBILITY "enable accessibility support")
endif()
wx_option(wxUSE_UIACTIONSIMULATOR "use wxUIActionSimulator (experimental)")

View File

@@ -82,6 +82,35 @@ if(WXGTK)
list(APPEND wxTOOLKIT_DEFINITIONS ${${gtk_lib}_DEFINITIONS})
list(APPEND wxTOOLKIT_DEFINITIONS __WXGTK__)
set(wxTOOLKIT_VERSION ${${gtk_lib}_VERSION})
if(WIN32 AND MSVC)
if(WXGTK4)
list(APPEND wxTOOLKIT_LIBRARIES
libgtk-4.dll.a
libgdk-4.dll.a
)
elseif(WXGTK3)
list(APPEND wxTOOLKIT_LIBRARIES
libgtk-3.dll.a
libgdk-3.dll.a
)
elseif(WXGTK2)
list(APPEND wxTOOLKIT_LIBRARIES
gtk-win32-2.0
gdk-win32-2.0
)
endif()
list(APPEND wxTOOLKIT_LIBRARIES
gio-2.0
pangocairo-1.0
gdk_pixbuf-2.0
cairo
pango-1.0
gobject-2.0
gthread-2.0
glib-2.0
)
endif()
endif()
if(APPLE)