Merge pull request #4832 from Orphis/cmake_wx

wx: Move platform defines to wx setup header
This commit is contained in:
Matthew Parlane 2017-02-06 17:37:18 +13:00 committed by GitHub
commit 3cc4c02c5b
3 changed files with 4 additions and 5 deletions

View File

@ -910,10 +910,7 @@ if(NOT DISABLE_WX)
# These definitions and includes are used when building dolphin against wx, # These definitions and includes are used when building dolphin against wx,
# not when building wx itself (see wxw3 CMakeLists.txt for that) # not when building wx itself (see wxw3 CMakeLists.txt for that)
if(APPLE) if(APPLE)
add_definitions(-D__WXOSX_COCOA__)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
add_definitions(-D__WXGTK__)
# Check for required libs # Check for required libs
check_lib(GTHREAD2 gthread-2.0 gthread-2.0 glib/gthread.h REQUIRED) check_lib(GTHREAD2 gthread-2.0 gthread-2.0 glib/gthread.h REQUIRED)
check_lib(PANGOCAIRO pangocairo pangocairo pango/pangocairo.h REQUIRED) check_lib(PANGOCAIRO pangocairo pangocairo pango/pangocairo.h REQUIRED)
@ -921,7 +918,6 @@ if(NOT DISABLE_WX)
# Required for wxUSE_STACKWALKER in Externals/wxWidgets3/wx/wxgtk.h # Required for wxUSE_STACKWALKER in Externals/wxWidgets3/wx/wxgtk.h
find_package(Backtrace REQUIRED) find_package(Backtrace REQUIRED)
elseif(WIN32) elseif(WIN32)
add_definitions(-D__WXMSW__)
else() else()
message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform") message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform")
endif() endif()

View File

@ -1,9 +1,12 @@
#ifdef __APPLE__ #ifdef __APPLE__
#define __WXMAC__ #define __WXMAC__
#define __WXOSX__ #define __WXOSX__
#define __WXOSX_COCOA__
#include "wx/wxcocoa.h" #include "wx/wxcocoa.h"
#elif defined _WIN32 #elif defined _WIN32
#define __WXMSW__
#include "wx/wxmsw.h" #include "wx/wxmsw.h"
#else #else
#define __WXGTK__
#include "wx/wxgtk.h" #include "wx/wxgtk.h"
#endif #endif

View File

@ -8,7 +8,7 @@
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>wx/wxprec.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>wx/wxprec.h</PrecompiledHeaderFile>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<PreprocessorDefinitions>__WXMSW__;WXBUILDING;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WXBUILDING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\;..\..\include;..\..\..\xxhash;..\..\..\zlib;..\..\..\libpng</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\;..\..\include;..\..\..\xxhash;..\..\..\zlib;..\..\..\libpng</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>