@@ -3,6 +3,8 @@ from misc.utility.scons_hints import *
3
3
4
4
Import ("env" )
5
5
6
+ File = env .File
7
+
6
8
# TODO: Add warning to headers and code about their autogenerated status.
7
9
if env ["use_sowrap" ]:
8
10
# We have to implement separate builders for so wrappers as the
@@ -41,14 +43,14 @@ else:
41
43
42
44
43
45
def generate_from_xml (name , path ):
44
- header = env .WAYLAND_API_HEADER (f"protocol/{ name } .gen.h" , path )
45
- 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 )
46
48
env .NoCache (header , source )
47
49
48
- return env . Object ( f"protocol/ { name } .gen.c" )
50
+ return source
49
51
50
52
51
- objects = [
53
+ generated_sources = [
52
54
# Core protocol
53
55
generate_from_xml ("wayland" , "#thirdparty/wayland/protocol/wayland.xml" ),
54
56
# Stable protocols
@@ -97,34 +99,31 @@ objects = [
97
99
),
98
100
]
99
101
100
- source_files = [
101
- "detect_prime_egl.cpp" ,
102
- "display_server_wayland.cpp" ,
103
- "key_mapping_xkb.cpp" ,
104
- "wayland_thread.cpp" ,
102
+ source_files = generated_sources + [
103
+ File ( "detect_prime_egl.cpp" ) ,
104
+ File ( "display_server_wayland.cpp" ) ,
105
+ File ( "key_mapping_xkb.cpp" ) ,
106
+ File ( "wayland_thread.cpp" ) ,
105
107
]
106
108
107
109
if env ["use_sowrap" ]:
108
110
source_files .append (
109
111
[
110
- "dynwrappers/wayland-cursor-so_wrap.c" ,
111
- "dynwrappers/wayland-client-core-so_wrap.c" ,
112
- "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" ) ,
113
115
]
114
116
)
115
117
116
118
if env ["libdecor" ]:
117
- source_files .append ("dynwrappers/libdecor-so_wrap.c" )
119
+ source_files .append (File ( "dynwrappers/libdecor-so_wrap.c" ) )
118
120
119
121
120
122
if env ["vulkan" ]:
121
- source_files .append ("rendering_context_driver_vulkan_wayland.cpp" )
123
+ source_files .append (File ( "rendering_context_driver_vulkan_wayland.cpp" ) )
122
124
123
125
if env ["opengl3" ]:
124
- source_files .append ("egl_manager_wayland.cpp" )
125
- source_files .append ("egl_manager_wayland_gles.cpp" )
126
-
127
- for source_file in source_files :
128
- objects .append (env .Object (source_file ))
126
+ source_files .append (File ("egl_manager_wayland.cpp" ))
127
+ source_files .append (File ("egl_manager_wayland_gles.cpp" ))
129
128
130
- Return ("objects " )
129
+ Return ("source_files " )
0 commit comments