@@ -52,59 +52,12 @@ fn cargo_main() {
5252 }
5353
5454 if cfg ! ( feature = "libc" ) {
55- cfg. file ( "third_party/libc/musl/src/ctype/isalpha.c" )
56- . file ( "third_party/libc/musl/src/ctype/isalnum.c" )
57- . file ( "third_party/libc/musl/src/ctype/isdigit.c" )
58- . file ( "third_party/libc/musl/src/ctype/isgraph.c" )
59- . file ( "third_party/libc/musl/src/ctype/islower.c" )
60- . file ( "third_party/libc/musl/src/ctype/isprint.c" )
61- . file ( "third_party/libc/musl/src/ctype/isspace.c" )
62- . file ( "third_party/libc/musl/src/ctype/isupper.c" )
63- . file ( "third_party/libc/musl/src/ctype/isxdigit.c" )
64- . file ( "third_party/libc/musl/src/ctype/tolower.c" )
65- . file ( "third_party/libc/musl/src/ctype/toupper.c" )
66- . file ( "third_party/libc/musl/src/errno/__errno_location.c" )
67- . file ( "third_party/libc/musl/src/internal/floatscan.c" )
68- . file ( "third_party/libc/musl/src/internal/intscan.c" )
69- . file ( "third_party/libc/musl/src/internal/shgetc.c" )
70- . file ( "third_party/libc/musl/src/math/copysign.c" )
71- . file ( "third_party/libc/musl/src/math/copysignl.c" )
72- . file ( "third_party/libc/musl/src/math/fabs.c" )
73- . file ( "third_party/libc/musl/src/math/fabsl.c" )
74- . file ( "third_party/libc/musl/src/math/fmod.c" )
75- . file ( "third_party/libc/musl/src/math/fmodl.c" )
76- . file ( "third_party/libc/musl/src/math/scalbnl.c" )
77- . file ( "third_party/libc/musl/src/math/__signbit.c" )
78- . file ( "third_party/libc/musl/src/math/__signbitl.c" )
79- . file ( "third_party/libc/musl/src/math/__fpclassify.c" )
80- . file ( "third_party/libc/musl/src/math/__fpclassifyl.c" )
81- . file ( "third_party/libc/musl/src/stdio/__toread.c" )
82- . file ( "third_party/libc/musl/src/stdio/__uflow.c" )
83- . file ( "third_party/libc/musl/src/stdlib/atoi.c" )
84- . file ( "third_party/libc/musl/src/stdlib/strtod.c" )
85- . file ( "third_party/libc/musl/src/stdlib/strtol.c" )
86- . file ( "third_party/libc/musl/src/stdlib/qsort.c" )
87- . file ( "third_party/libc/musl/src/stdlib/qsort_nr.c" )
88- . file ( "third_party/libc/musl/src/stdlib/bsearch.c" )
89- . file ( "third_party/libc/musl/src/string/memchr.c" )
90- . file ( "third_party/libc/musl/src/string/memcmp.c" )
91- . file ( "third_party/libc/musl/src/string/memcpy.c" )
92- . file ( "third_party/libc/musl/src/string/memmove.c" )
93- . file ( "third_party/libc/musl/src/string/memset.c" )
94- . file ( "third_party/libc/musl/src/string/stpncpy.c" )
95- . file ( "third_party/libc/musl/src/string/strchr.c" )
96- . file ( "third_party/libc/musl/src/string/strchrnul.c" )
97- . file ( "third_party/libc/musl/src/string/strcmp.c" )
98- . file ( "third_party/libc/musl/src/string/strcspn.c" )
99- . file ( "third_party/libc/musl/src/string/strlen.c" )
100- . file ( "third_party/libc/musl/src/string/strncasecmp.c" )
101- . file ( "third_party/libc/musl/src/string/strncat.c" )
102- . file ( "third_party/libc/musl/src/string/strncmp.c" )
103- . file ( "third_party/libc/musl/src/string/strncpy.c" )
104- . file ( "third_party/libc/musl/src/string/strspn.c" )
105- . file ( "third_party/libc/musl/src/string/strstr.c" )
106- . file ( "third_party/libc/musl/src/prng/rand.c" )
107- . include ( "third_party/libc/musl/src/include" )
55+ let entries = glob:: glob ( "third_party/libc/musl/**/*.[cs]" ) // .c and .s files
56+ . expect ( "glob pattern should be valid" )
57+ . filter_map ( Result :: ok) ;
58+ cfg. files ( entries) ;
59+
60+ cfg. include ( "third_party/libc/musl/src/include" )
10861 . include ( "third_party/libc/musl/include" )
10962 . include ( "third_party/libc/musl/src/internal" )
11063 . include ( "third_party/libc/musl/arch/generic" )
@@ -132,14 +85,18 @@ fn cargo_main() {
13285 }
13386 cfg. define ( "__x86_64__" , None ) ;
13487 cfg. define ( "__LITTLE_ENDIAN__" , None ) ;
88+ cfg. define ( "HYPERLIGHT" , None ) ;
13589
13690 // silence compiler warnings
137- cfg. flag ( "-Wno-sign-compare" ) ;
138- cfg. flag ( "-Wno-bitwise-op-parentheses" ) ;
139- cfg. flag ( "-Wno-unknown-pragmas" ) ;
140- cfg. flag ( "-Wno-shift-op-parentheses" ) ;
141- cfg. flag ( "-Wno-logical-op-parentheses" ) ;
142- cfg. flag ( "-Wno-unused-but-set-variable" ) ;
91+ cfg. flag ( "-Wno-unused-command-line-argument" ) // including .s files makes clang believe arguments are unused
92+ . flag ( "-Wno-sign-compare" )
93+ . flag ( "-Wno-bitwise-op-parentheses" )
94+ . flag ( "-Wno-unknown-pragmas" )
95+ . flag ( "-Wno-shift-op-parentheses" )
96+ . flag ( "-Wno-logical-op-parentheses" )
97+ . flag ( "-Wno-unused-but-set-variable" )
98+ . flag ( "-Wno-unused-parameter" )
99+ . flag ( "-Wno-string-plus-int" ) ;
143100
144101 if is_pe {
145102 cfg. compiler ( "clang-cl" ) ;
0 commit comments