From 6a0cb481491384a5c7338f4723b7d44f490d4f76 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 May 2020 20:22:21 +1000 Subject: GHOST: cleanup platform checks, fix Wayland + X11 - Building with Wayland + X11 missed an exception include. - Move HEADLESS check first, since it's the same on all platforms. --- intern/ghost/intern/GHOST_ISystem.cpp | 45 ++++++++++++++++------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/intern/ghost/intern/GHOST_ISystem.cpp b/intern/ghost/intern/GHOST_ISystem.cpp index 9e3bf66d925..7c12bfe0306 100644 --- a/intern/ghost/intern/GHOST_ISystem.cpp +++ b/intern/ghost/intern/GHOST_ISystem.cpp @@ -27,25 +27,22 @@ #include "GHOST_ISystem.h" -#if defined(WITH_GHOST_X11) || defined(WITH_GHOST_WAYLAND) -# ifdef WITH_GHOST_X11 -# include "GHOST_SystemX11.h" -# endif -# ifdef WITH_GHOST_WAYLAND -# include "GHOST_SystemWayland.h" -# endif -#else -# ifdef WITH_HEADLESS -# include "GHOST_SystemNULL.h" -# elif defined(WITH_GHOST_SDL) -# include "GHOST_SystemSDL.h" -# elif defined(WIN32) -# include "GHOST_SystemWin32.h" -# else -# ifdef __APPLE__ -# include "GHOST_SystemCocoa.h" -# endif -# endif +#if defined(WITH_HEADLESS) +# include "GHOST_SystemNULL.h" +#elif defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND) +# include "GHOST_SystemWayland.h" +# include "GHOST_SystemX11.h" +# include +#elif defined(WITH_GHOST_X11) +# include "GHOST_SystemX11.h" +#elif defined(WITH_GHOST_WAYLAND) +# include "GHOST_SystemWayland.h" +#elif defined(WITH_GHOST_SDL) +# include "GHOST_SystemSDL.h" +#elif defined(WIN32) +# include "GHOST_SystemWin32.h" +#elif defined(__APPLE__) +# include "GHOST_SystemCocoa.h" #endif GHOST_ISystem *GHOST_ISystem::m_system = NULL; @@ -54,7 +51,9 @@ GHOST_TSuccess GHOST_ISystem::createSystem() { GHOST_TSuccess success; if (!m_system) { -#if defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND) +#if defined(WITH_HEADLESS) + m_system = new GHOST_SystemNULL(); +#elif defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND) /* Special case, try Wayland, fall back to X11. */ try { m_system = new GHOST_SystemWayland(); @@ -69,16 +68,12 @@ GHOST_TSuccess GHOST_ISystem::createSystem() m_system = new GHOST_SystemX11(); #elif defined(WITH_GHOST_WAYLAND) m_system = new GHOST_SystemWayland(); -#elif defined(WITH_HEADLESS) - m_system = new GHOST_SystemNULL(); #elif defined(WITH_GHOST_SDL) m_system = new GHOST_SystemSDL(); #elif defined(WIN32) m_system = new GHOST_SystemWin32(); -#else -# ifdef __APPLE__ +#elif defined(__APPLE__) m_system = new GHOST_SystemCocoa(); -# endif #endif success = m_system != NULL ? GHOST_kSuccess : GHOST_kFailure; } -- cgit v1.2.3