@@ -82,21 +82,26 @@ fn addPhysfs(
82
82
.target = target ,
83
83
.optimize = optimize ,
84
84
});
85
+ var files = std .ArrayList ([]const u8 ).init (b .allocator );
86
+ files .appendSlice (&.{
87
+ "src/physfs.c" ,
88
+ "src/physfs_archiver_dir.c" ,
89
+ "src/physfs_archiver_unpacked.c" ,
90
+ "src/physfs_archiver_zip.c" ,
91
+ "src/physfs_byteorder.c" ,
92
+ "src/physfs_unicode.c" ,
93
+ "src/physfs_platform_posix.c" ,
94
+ "src/physfs_platform_unix.c" ,
95
+ "src/physfs_platform_windows.c" ,
96
+ "src/physfs_platform_haiku.cpp" ,
97
+ "src/physfs_platform_android.c" ,
98
+ }) catch @panic ("OOM" );
99
+ if (target .result .isDarwin ()) {
100
+ files .append ("src/physfs_platform_apple.m" ) catch @panic ("OOM" );
101
+ }
85
102
lib .addCSourceFiles (.{
86
103
.root = root ,
87
- .files = &.{
88
- "src/physfs.c" ,
89
- "src/physfs_archiver_dir.c" ,
90
- "src/physfs_archiver_unpacked.c" ,
91
- "src/physfs_archiver_zip.c" ,
92
- "src/physfs_byteorder.c" ,
93
- "src/physfs_unicode.c" ,
94
- "src/physfs_platform_posix.c" ,
95
- "src/physfs_platform_unix.c" ,
96
- "src/physfs_platform_windows.c" ,
97
- "src/physfs_platform_haiku.cpp" ,
98
- "src/physfs_platform_android.c" ,
99
- },
104
+ .files = files .toOwnedSlice () catch @panic ("OOM" ),
100
105
.flags = &.{
101
106
"-DPHYSFS_SUPPORTS_DEFAULT=0" ,
102
107
"-DPHYSFS_SUPPORTS_ZIP=1" ,
0 commit comments