@@ -174,29 +174,27 @@ pub fn build(b: *std.Build) void {
174174 b .installArtifact (colyseus );
175175
176176 // Install colyseus headers
177- const install_client_h = b .addInstallHeaderFile (b .path ("include/colyseus/client.h" ), "colyseus/client.h" );
178- const install_http_h = b .addInstallHeaderFile (b .path ("include/colyseus/http.h" ), "colyseus/http.h" );
179- const install_protocol_h = b .addInstallHeaderFile (b .path ("include/colyseus/protocol.h" ), "colyseus/protocol.h" );
180- const install_room_h = b .addInstallHeaderFile (b .path ("include/colyseus/room.h" ), "colyseus/room.h" );
181- const install_settings_h = b .addInstallHeaderFile (b .path ("include/colyseus/settings.h" ), "colyseus/settings.h" );
182- const install_transport_h = b .addInstallHeaderFile (b .path ("include/colyseus/transport.h" ), "colyseus/transport.h" );
183- const install_websocket_h = b .addInstallHeaderFile (b .path ("include/colyseus/websocket_transport.h" ), "colyseus/websocket_transport.h" );
184- const install_sha1_h = b .addInstallHeaderFile (b .path ("include/colyseus/utils/sha1_c.h" ), "colyseus/utils/sha1_c.h" );
185- const install_strutil_h = b .addInstallHeaderFile (b .path ("include/colyseus/utils/strUtil.h" ), "colyseus/utils/strUtil.h" );
186- const install_auth_auth_h = b .addInstallHeaderFile (b .path ("include/colyseus/auth/auth.h" ), "colyseus/auth/auth.h" );
187- const install_auth_secure_storage_h = b .addInstallHeaderFile (b .path ("include/colyseus/auth/secure_storage.h" ), "colyseus/auth/secure_storage.h" );
188-
189- b .getInstallStep ().dependOn (& install_client_h .step );
190- b .getInstallStep ().dependOn (& install_http_h .step );
191- b .getInstallStep ().dependOn (& install_protocol_h .step );
192- b .getInstallStep ().dependOn (& install_room_h .step );
193- b .getInstallStep ().dependOn (& install_settings_h .step );
194- b .getInstallStep ().dependOn (& install_transport_h .step );
195- b .getInstallStep ().dependOn (& install_websocket_h .step );
196- b .getInstallStep ().dependOn (& install_sha1_h .step );
197- b .getInstallStep ().dependOn (& install_strutil_h .step );
198- b .getInstallStep ().dependOn (& install_auth_auth_h .step );
199- b .getInstallStep ().dependOn (& install_auth_secure_storage_h .step );
177+ const headers = .{
178+ "client.h" ,
179+ "http.h" ,
180+ "protocol.h" ,
181+ "room.h" ,
182+ "settings.h" ,
183+ "transport.h" ,
184+ "websocket_transport.h" ,
185+ "utils/sha1_c.h" ,
186+ "utils/strUtil.h" ,
187+ "auth/auth.h" ,
188+ "auth/secure_storage.h" ,
189+ };
190+
191+ inline for (headers ) | header | {
192+ const install_header = b .addInstallHeaderFile (
193+ b .path ("include/colyseus/" ++ header ),
194+ "colyseus/" ++ header ,
195+ );
196+ b .getInstallStep ().dependOn (& install_header .step );
197+ }
200198
201199 // ========================================================================
202200 // Helper function to build examples
0 commit comments