summaryrefslogtreecommitdiff
path: root/gui-wm/wayfire/files/wayfire-0.8.0-dont-use-installed-config-h.patch
blob: 3938cd955ce225b768e0d1071ef179b14ccf1879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
https://github.com/WayfireWM/wayfire/pull/2225

From f7bcad19598cbff1324f7737022ffee8848b3555 Mon Sep 17 00:00:00 2001
From: Alfred Wingate <parona@protonmail.com>
Date: Mon, 18 Mar 2024 16:32:06 +0200
Subject: [PATCH] Copy config.h approach from wlroots-full.hpp to other public
 api headers (#2225)

* Otherwise wayfire could use the config.h of an already installed
  wayfire installation and lead to confusing linking issues if the
  options differed (like installed wayfire has xwayland disabled and the
  new build has it enabled).

Signed-off-by: Alfred Wingate <parona@protonmail.com>
--- a/src/api/wayfire/debug.hpp
+++ b/src/api/wayfire/debug.hpp
@@ -1,8 +1,12 @@
 #ifndef DEBUG_HPP
 #define DEBUG_HPP
 
-#ifndef WAYFIRE_PLUGIN
-    #include "config.h"
+// WF_USE_CONFIG_H is set only when building Wayfire itself, external plugins
+// need to use <wayfire/config.h>
+#ifdef WF_USE_CONFIG_H
+    #include <config.h>
+#else
+    #include <wayfire/config.h>
 #endif
 
 #define nonull(x) ((x) ? (x) : ("nil"))
--- a/src/api/wayfire/unstable/wlr-view-events.hpp
+++ b/src/api/wayfire/unstable/wlr-view-events.hpp
@@ -1,9 +1,11 @@
 #pragma once
 
-#if __has_include(<wayfire/config.h>)
-    #include <wayfire/config.h>
+// WF_USE_CONFIG_H is set only when building Wayfire itself, external plugins
+// need to use <wayfire/config.h>
+#ifdef WF_USE_CONFIG_H
+    #include <config.h>
 #else
-    #include "config.h"
+    #include <wayfire/config.h>
 #endif
 
 #include <wayfire/nonstd/wlroots-full.hpp>
--- a/src/api/wayfire/unstable/xwl-toplevel-base.hpp
+++ b/src/api/wayfire/unstable/xwl-toplevel-base.hpp
@@ -1,9 +1,11 @@
 #pragma once
 
-#if __has_include(<wayfire/config.h>)
-    #include <wayfire/config.h>
+// WF_USE_CONFIG_H is set only when building Wayfire itself, external plugins
+// need to use <wayfire/config.h>
+#ifdef WF_USE_CONFIG_H
+    #include <config.h>
 #else
-    #include "config.h"
+    #include <wayfire/config.h>
 #endif
 
 #include <wayfire/nonstd/wlroots-full.hpp>