mirror of
https://gitlab.com/veloren/veloren
synced 2026-08-16 16:26:07 -04:00
Relax platform checks
This commit is contained in:
parent
3e909919d0
commit
6f41da2385
4 changed files with 6 additions and 6 deletions
|
|
@ -74,14 +74,14 @@ fn main() -> io::Result<()> {
|
|||
// Load settings
|
||||
let settings = settings::Settings::load().ok_or(io::ErrorKind::Other)?;
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
for signal in &settings.shutdown_signals {
|
||||
let _ = signal_hook::flag::register(signal.to_signal(), Arc::clone(&shutdown_signal));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
|
||||
#[cfg(target_os = "windows")]
|
||||
if !settings.shutdown_signals.is_empty() {
|
||||
tracing::warn!(
|
||||
"Server configuration contains shutdown signals, but your platform does not support \
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ pub enum ShutdownSignal {
|
|||
}
|
||||
|
||||
impl ShutdownSignal {
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
pub fn to_signal(self) -> core::ffi::c_int {
|
||||
match self {
|
||||
Self::SIGUSR1 => signal_hook::consts::SIGUSR1,
|
||||
|
|
@ -48,7 +48,7 @@ impl Default for Settings {
|
|||
web_address: SocketAddr::from((Ipv4Addr::LOCALHOST, 14005)),
|
||||
web_chat_secret: None,
|
||||
ui_api_secret: None,
|
||||
shutdown_signals: if cfg!(any(target_os = "linux", target_os = "macos")) {
|
||||
shutdown_signals: if cfg!(not(target_os = "windows")) {
|
||||
vec![ShutdownSignal::SIGUSR1]
|
||||
} else {
|
||||
Vec::new()
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ fn main() {
|
|||
cli::Commands::ListWgpuBackends => {
|
||||
#[cfg(target_os = "windows")]
|
||||
let backends = &["opengl", "dx12", "vulkan"];
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
|
||||
let backends = &["opengl", "vulkan"];
|
||||
#[cfg(target_os = "macos")]
|
||||
let backends = &["metal"];
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ impl Window {
|
|||
))
|
||||
.with_maximized(window.maximised);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
|
||||
{
|
||||
use winit::platform::wayland::WindowAttributesExtWayland;
|
||||
attributes = attributes.with_name("net.veloren.veloren", "veloren");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue