File tree 1 file changed +16
-0
lines changed
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) {
46
46
}
47
47
}
48
48
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
+
49
64
fn write_definitions_header ( ) {
50
65
// We cannot ensure that downstream dependencies set the same compile-time definitions.
51
66
// So we generate a header file that adds those definitions, which will be passed along
@@ -102,6 +117,7 @@ fn main() {
102
117
let qtbuild = qt_build_utils:: QtBuild :: new ( vec ! [ "Core" . to_owned( ) ] )
103
118
. expect ( "Could not find Qt installation" ) ;
104
119
120
+ clear_include_directory ( ) ;
105
121
write_headers ( ) ;
106
122
107
123
let emscripten_targeted = match std:: env:: var ( "CARGO_CFG_TARGET_OS" ) {
You can’t perform that action at this time.
0 commit comments