Use preprocessor to exclude platform specify code instead of cmake
This commit is contained in:
@@ -4,14 +4,12 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifdef NOVA_LINUX
|
||||
|
||||
#include "drivers/linux/system_driver.h"
|
||||
|
||||
#ifdef NOVA_WAYLAND
|
||||
#include "drivers/linux/wayland/system_driver.h"
|
||||
#endif
|
||||
#ifdef NOVA_X11
|
||||
#include "drivers/linux/x11/system_driver.h"
|
||||
#endif
|
||||
#include "drivers/linux/wayland/system_driver.h" // IWYU pragma: keep
|
||||
#include "drivers/linux/x11/system_driver.h" // IWYU pragma: keep
|
||||
|
||||
#include <nova/core/debug.h>
|
||||
|
||||
@@ -47,3 +45,5 @@ std::unique_ptr<SystemDriver> LinuxSystemDriver::get_default_driver() {
|
||||
NOVA_WARN("Unsupported display server");
|
||||
return std::make_unique<LinuxSystemDriver>();
|
||||
}
|
||||
|
||||
#endif // NOVA_LINUX
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef NOVA_LINUX
|
||||
|
||||
#include <nova/platform/system_driver.h>
|
||||
|
||||
#include <memory>
|
||||
@@ -21,3 +23,5 @@ namespace Nova {
|
||||
static std::unique_ptr<SystemDriver> get_default_driver();
|
||||
};
|
||||
} // namespace Nova
|
||||
|
||||
#endif // NOVA_LINUX
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifdef NOVA_WAYLAND
|
||||
|
||||
#include "drivers/linux/wayland/system_driver.h"
|
||||
|
||||
#include <nova/core/debug.h>
|
||||
@@ -17,3 +19,5 @@ WaylandSystemDriver::WaylandSystemDriver() {
|
||||
WaylandSystemDriver::~WaylandSystemDriver() {
|
||||
NOVA_AUTO_TRACE();
|
||||
}
|
||||
|
||||
#endif // NOVA_WAYLAND
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef NOVA_WAYLAND
|
||||
|
||||
#include "drivers/linux/system_driver.h"
|
||||
|
||||
namespace Nova {
|
||||
@@ -15,3 +17,5 @@ namespace Nova {
|
||||
~WaylandSystemDriver() override;
|
||||
};
|
||||
} // namespace Nova
|
||||
|
||||
#endif // NOVA_WAYLAND
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifdef NOVA_X11
|
||||
|
||||
#include "drivers/linux/x11/system_driver.h"
|
||||
|
||||
#ifdef NOVA_VULKAN
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vulkan_xlib.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vulkan_xlib.h>
|
||||
#endif
|
||||
|
||||
#include <nova/core/debug.h>
|
||||
@@ -30,3 +32,5 @@ const char* X11SystemDriver::get_surface_extension() const {
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // NOVA_X11
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef NOVA_X11
|
||||
|
||||
#include "drivers/linux/system_driver.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
@@ -19,3 +21,5 @@ namespace Nova {
|
||||
[[nodiscard]] const char* get_surface_extension() const override;
|
||||
};
|
||||
} // namespace Nova
|
||||
|
||||
#endif // NOVA_X11
|
||||
|
||||
Reference in New Issue
Block a user