@@ -3,6 +3,8 @@ from misc.utility.scons_hints import *
33
44Import ("env" )
55
6+ File = env .File
7+
68# TODO: Add warning to headers and code about their autogenerated status.
79if env ["use_sowrap" ]:
810 # We have to implement separate builders for so wrappers as the
@@ -41,14 +43,14 @@ else:
4143
4244
4345def 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 )
4648 env .NoCache (header , source )
4749
48- return env . Object ( f"protocol/ { name } .gen.c" )
50+ return source
4951
5052
51- objects = [
53+ generated_sources = [
5254 # Core protocol
5355 generate_from_xml ("wayland" , "#thirdparty/wayland/protocol/wayland.xml" ),
5456 # Stable protocols
@@ -97,34 +99,31 @@ objects = [
9799 ),
98100]
99101
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" ) ,
105107]
106108
107109if env ["use_sowrap" ]:
108110 source_files .append (
109111 [
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" ) ,
113115 ]
114116 )
115117
116118 if env ["libdecor" ]:
117- source_files .append ("dynwrappers/libdecor-so_wrap.c" )
119+ source_files .append (File ( "dynwrappers/libdecor-so_wrap.c" ) )
118120
119121
120122if env ["vulkan" ]:
121- source_files .append ("rendering_context_driver_vulkan_wayland.cpp" )
123+ source_files .append (File ( "rendering_context_driver_vulkan_wayland.cpp" ) )
122124
123125if 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" ))
129128
130- Return ("objects " )
129+ Return ("source_files " )
0 commit comments