Skip to content

Commit 1c415dc

Browse files
committed
Try using scons's Path.
1 parent 2ce9bd9 commit 1c415dc

File tree

2 files changed

+32
-36
lines changed

2 files changed

+32
-36
lines changed

platform/linuxbsd/wayland/SCsub

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ from misc.utility.scons_hints import *
33

44
Import("env")
55

6-
base = "#platform/linuxbsd/wayland/"
6+
File = env.File
77

88
# TODO: Add warning to headers and code about their autogenerated status.
99
if env["use_sowrap"]:
@@ -43,11 +43,11 @@ else:
4343

4444

4545
def generate_from_xml(name, path):
46-
header = env.WAYLAND_API_HEADER(f"protocol/{name}.gen.h", path)
47-
source = env.WAYLAND_API_CODE(f"protocol/{name}.gen.c", path)
46+
header = env.WAYLAND_API_HEADER(File(f"protocol/{name}.gen.h"), path)
47+
source = env.WAYLAND_API_CODE(File(f"protocol/{name}.gen.c"), path)
4848
env.NoCache(header, source)
4949

50-
return f"protocol/{name}.gen.c"
50+
return source
5151

5252

5353
generated_sources = [
@@ -100,34 +100,30 @@ generated_sources = [
100100
]
101101

102102
source_files = generated_sources + [
103-
"detect_prime_egl.cpp",
104-
"display_server_wayland.cpp",
105-
"key_mapping_xkb.cpp",
106-
"wayland_thread.cpp",
103+
File("detect_prime_egl.cpp"),
104+
File("display_server_wayland.cpp"),
105+
File("key_mapping_xkb.cpp"),
106+
File("wayland_thread.cpp"),
107107
]
108108

109109
if env["use_sowrap"]:
110110
source_files.extend(
111111
[
112-
"dynwrappers/wayland-cursor-so_wrap.c",
113-
"dynwrappers/wayland-client-core-so_wrap.c",
114-
"dynwrappers/wayland-egl-core-so_wrap.c",
112+
File("dynwrappers/wayland-cursor-so_wrap.c"),
113+
File("dynwrappers/wayland-client-core-so_wrap.c"),
114+
File("dynwrappers/wayland-egl-core-so_wrap.c"),
115115
]
116116
)
117117

118118
if env["libdecor"]:
119-
source_files.append("dynwrappers/libdecor-so_wrap.c")
119+
source_files.append(File("dynwrappers/libdecor-so_wrap.c"))
120120

121121

122122
if env["vulkan"]:
123-
source_files.append("rendering_context_driver_vulkan_wayland.cpp")
123+
source_files.append(File("rendering_context_driver_vulkan_wayland.cpp"))
124124

125125
if env["opengl3"]:
126-
source_files.append("egl_manager_wayland.cpp")
127-
source_files.append("egl_manager_wayland_gles.cpp")
128-
129-
# Prepend base path to all source files
130-
for i, source_file in enumerate(source_files):
131-
source_files[i] = base + source_file
126+
source_files.append(File("egl_manager_wayland.cpp"))
127+
source_files.append(File("egl_manager_wayland_gles.cpp"))
132128

133129
Return("source_files")

platform/linuxbsd/x11/SCsub

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@ from misc.utility.scons_hints import *
33

44
Import("env")
55

6-
base = "#platform/linuxbsd/x11/"
6+
File = env.File
77

88
source_files = [
9-
"display_server_x11.cpp",
10-
"key_mapping_x11.cpp",
9+
File("display_server_x11.cpp"),
10+
File("key_mapping_x11.cpp"),
1111
]
1212

1313
if env["use_sowrap"]:
1414
source_files.extend(
1515
[
16-
"dynwrappers/xlib-so_wrap.c",
17-
"dynwrappers/xcursor-so_wrap.c",
18-
"dynwrappers/xinerama-so_wrap.c",
19-
"dynwrappers/xinput2-so_wrap.c",
20-
"dynwrappers/xrandr-so_wrap.c",
21-
"dynwrappers/xrender-so_wrap.c",
22-
"dynwrappers/xext-so_wrap.c",
16+
File("dynwrappers/xlib-so_wrap.c"),
17+
File("dynwrappers/xcursor-so_wrap.c"),
18+
File("dynwrappers/xinerama-so_wrap.c"),
19+
File("dynwrappers/xinput2-so_wrap.c"),
20+
File("dynwrappers/xrandr-so_wrap.c"),
21+
File("dynwrappers/xrender-so_wrap.c"),
22+
File("dynwrappers/xext-so_wrap.c"),
2323
]
2424
)
2525

2626
if env["vulkan"]:
27-
source_files.append("rendering_context_driver_vulkan_x11.cpp")
27+
source_files.append(File("rendering_context_driver_vulkan_x11.cpp"))
2828

2929
if env["opengl3"]:
3030
env.Append(CPPDEFINES=["GLAD_GLX_NO_X11"])
3131
source_files.extend(
32-
["gl_manager_x11_egl.cpp", "gl_manager_x11.cpp", "detect_prime_x11.cpp", "#thirdparty/glad/glx.c"]
32+
[
33+
File("gl_manager_x11_egl.cpp"),
34+
File("gl_manager_x11.cpp"),
35+
File("detect_prime_x11.cpp"),
36+
"#thirdparty/glad/glx.c",
37+
]
3338
)
3439

35-
# Prepend base path to relative paths (skip absolute paths starting with #)
36-
for i, source_file in enumerate(source_files):
37-
if not source_file.startswith("#"):
38-
source_files[i] = base + source_file
39-
4040
Return("source_files")

0 commit comments

Comments
 (0)