MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / main

Function main

scripts/getinclude.py:14–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12import re
13
14def main():
15 cxx = 'g++'
16 if 2 == len(sys.argv):
17 cxx = sys.argv[1]
18
19 cmd = [cxx, '-E', '-x', 'c++', '-v', '/dev/null']
20 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
21 stdout, stderr = p.communicate()
22
23 m = re.findall(b'\n (/.*)', stderr)
24
25 includes = ''
26
27 for x in m:
28 if -1 != x.find(b'(framework directory)'):
29 continue
30
31 includes += '-isystem%s ' % os.path.normpath(x.decode())
32
33 print(includes)
34
35 return 1
36#------------------------------------------------------------------------------
37
38sys.exit(main())

Callers 1

getinclude.pyFile · 0.70

Calls 1

printFunction · 0.85

Tested by

no test coverage detected