File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ gen_push_tuple: push_tuple_generator.py
55
66gen_ref_tuple : ref_tuple_generator.py
77 python ref_tuple_generator.py > ../include/kaguya/gen/ref_tuple.inl
8+
9+ one_header_file : generate_one_header.py
10+ python generate_one_header.py > ../kaguya.hpp
811
912clean :
1013
Original file line number Diff line number Diff line change 1+
2+ import os
3+ import sys
4+ import re
5+
6+ def inner_include_path (line ):
7+ m = re .search ('#include\s\" (?P<headername>.*)\" ' ,line )
8+ if m :
9+ return m .group ('headername' )
10+ return None ;
11+
12+ def parseheader (out ,filepath ,basedir ,onceincludedfiles ):
13+
14+ for line in open (os .path .join (basedir ,filepath ), 'r' ):
15+ if line .find ('#pragma once' ) != - 1 :
16+ onceincludedfiles .append (os .path .join (basedir ,filepath ))
17+ path = inner_include_path (line )
18+ if path :
19+ if not os .path .join (basedir ,path ) in onceincludedfiles :
20+ parseheader (out ,path ,basedir ,onceincludedfiles )
21+ else :
22+ out .write (line )
23+
24+ if __name__ == "__main__" :
25+ onceincludedfiles = []
26+ parseheader (sys .stdout ,'kaguya\\ kaguya.hpp' ,'..\\ include\\ ' ,onceincludedfiles )
You can’t perform that action at this time.
0 commit comments