Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-01 13:07:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-01 13:07:01 +0300
commitd7d140ec7ffa4d84433c3075a4cc909ce584a3ab (patch)
tree5e9ffffc3a2f99d3dbafb6ec707f9a8f358a14ab /intern/ghost
parent9a4844cfdb1a4a29e1bf66b045d4e2e4a0a5dd0f (diff)
CMake: add WITH_GHOST_X11 option
- Support building only with Wayland. - In this case, show useful error messages when Wayland fails to load.
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_ISystem.cpp26
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp6
2 files changed, 16 insertions, 16 deletions
diff --git a/intern/ghost/intern/GHOST_ISystem.cpp b/intern/ghost/intern/GHOST_ISystem.cpp
index 11d1c501d04..9e3bf66d925 100644
--- a/intern/ghost/intern/GHOST_ISystem.cpp
+++ b/intern/ghost/intern/GHOST_ISystem.cpp
@@ -54,30 +54,30 @@ GHOST_TSuccess GHOST_ISystem::createSystem()
{
GHOST_TSuccess success;
if (!m_system) {
-#if defined(WITH_GHOST_X11) || defined(WITH_GHOST_WAYLAND)
-# ifdef WITH_GHOST_WAYLAND
+#if defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND)
+ /* Special case, try Wayland, fall back to X11. */
try {
m_system = new GHOST_SystemWayland();
}
- catch (const std::exception &) {
+ catch (const std::runtime_error &) {
+ /* fallback to X11. */
}
-# endif
-# ifdef WITH_GHOST_X11
if (!m_system) {
m_system = new GHOST_SystemX11();
}
-# endif
-#else
-# ifdef WITH_HEADLESS
+#elif defined(WITH_GHOST_X11)
+ 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)
+#elif defined(WITH_GHOST_SDL)
m_system = new GHOST_SystemSDL();
-# elif defined(WIN32)
+#elif defined(WIN32)
m_system = new GHOST_SystemWin32();
-# else
-# ifdef __APPLE__
+#else
+# ifdef __APPLE__
m_system = new GHOST_SystemCocoa();
-# endif
# endif
#endif
success = m_system != NULL ? GHOST_kSuccess : GHOST_kFailure;
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 9030a02abb1..666515ed088 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1197,7 +1197,7 @@ GHOST_SystemWayland::GHOST_SystemWayland() : GHOST_System(), d(new display_t)
d->display = wl_display_connect(nullptr);
if (!d->display) {
display_destroy(d);
- throw std::exception();
+ throw std::runtime_error("Wayland: unable to connect to display!");
}
/* Register interfaces. */
@@ -1211,7 +1211,7 @@ GHOST_SystemWayland::GHOST_SystemWayland() : GHOST_System(), d(new display_t)
if (!d->xdg_shell) {
display_destroy(d);
- throw std::exception();
+ throw std::runtime_error("Wayland: unable to access xdg_shell!");
}
/* Register data device per seat for IPC between Wayland clients. */
@@ -1230,7 +1230,7 @@ GHOST_SystemWayland::GHOST_SystemWayland() : GHOST_System(), d(new display_t)
d->cursor_theme = wl_cursor_theme_load(theme, sizei, d->shm);
if (!d->cursor_theme) {
display_destroy(d);
- throw std::exception();
+ throw std::runtime_error("Wayland: unable to access cursor themes!");
}
}