File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,21 @@ fn write_headers_in(subfolder: &str) {
4646 }
4747}
4848
49+ fn clear_include_directory ( ) {
50+ if !header_dir ( ) . exists ( ) {
51+ return ;
52+ }
53+ for entry in std:: fs:: read_dir ( header_dir ( ) . as_path ( ) ) . expect ( "Failed to read header directory" )
54+ {
55+ let path = entry. expect ( "Failed to read path" ) . path ( ) ;
56+ if path. is_dir ( ) {
57+ std:: fs:: remove_dir_all ( path) . expect ( "Failed to delete directory" ) ;
58+ } else {
59+ std:: fs:: remove_file ( path) . expect ( "Failed to delete file" ) ;
60+ }
61+ }
62+ }
63+
4964fn write_definitions_header ( ) {
5065 // We cannot ensure that downstream dependencies set the same compile-time definitions.
5166 // So we generate a header file that adds those definitions, which will be passed along
@@ -102,6 +117,7 @@ fn main() {
102117 let qtbuild = qt_build_utils:: QtBuild :: new ( vec ! [ "Core" . to_owned( ) ] )
103118 . expect ( "Could not find Qt installation" ) ;
104119
120+ clear_include_directory ( ) ;
105121 write_headers ( ) ;
106122
107123 let emscripten_targeted = match std:: env:: var ( "CARGO_CFG_TARGET_OS" ) {
You can’t perform that action at this time.
0 commit comments