CMake: move wxWidgets check_lib code into wxWidgets

This commit is contained in:
Michael Maltese 2017-04-24 14:14:07 -07:00
parent 6197d9622f
commit f4c0723387
2 changed files with 11 additions and 17 deletions

View File

@ -801,21 +801,6 @@ if(NOT DISABLE_WX)
else()
message(STATUS "Using static wxWidgets from Externals")
# These definitions and includes are used when building dolphin against wx,
# not when building wx itself (see wxw3 CMakeLists.txt for that)
if(APPLE)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
# Check for required libs
check_lib(GTHREAD2 gthread-2.0 gthread-2.0 glib/gthread.h REQUIRED)
check_lib(PANGOCAIRO pangocairo pangocairo pango/pangocairo.h REQUIRED)
# On Linux "backtrace" is part of glibc. FreeBSD has a separate library.
# Required for wxUSE_STACKWALKER in Externals/wxWidgets3/wx/wxgtk.h
find_package(Backtrace REQUIRED)
elseif(WIN32)
else()
message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform")
endif()
include_directories(SYSTEM
Externals/wxWidgets3
Externals/wxWidgets3/include)

View File

@ -860,7 +860,14 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
if (NOT X11_xf86vmode_FOUND OR NOT X11_Xinerama_FOUND)
message(FATAL_ERROR "wxGTK2 needs Xinerama and Xxf86vm")
endif()
find_package(GTK2 REQUIRED)
check_lib(GTHREAD2 gthread-2.0 gthread-2.0 glib/gthread.h REQUIRED)
check_lib(PANGOCAIRO pangocairo pangocairo pango/pangocairo.h REQUIRED)
# On Linux "backtrace" is part of glibc. FreeBSD has a separate library.
# Required for wxUSE_STACKWALKER in Externals/wxWidgets3/wx/wxgtk.h
find_package(Backtrace REQUIRED)
target_include_directories(wx PUBLIC ${GTK2_INCLUDE_DIRS})
target_link_libraries(wx PRIVATE
png
@ -872,7 +879,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
${X11_Xxf86vm_LIB}
${X11_Xinerama_LIB}
)
else()
elseif(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
target_compile_definitions(wx PRIVATE "__WXMSW__" "NOPCH")
target_sources(wx PRIVATE
@ -880,9 +887,11 @@ else()
${SRCS_MSW}
)
target_link_libraries(wx PRIVATE
Comctl32.lib
Comctl32.lib
Rpcrt4.lib
${OPENGL_LIBRARIES}
)
else()
message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform")
endif()