File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ from __future__ import print_function
2
+
3
+ import argparse
4
+ import sys
5
+ import sysconfig
6
+
7
+ from . import get_include
8
+
9
+
10
+ def print_includes ():
11
+ dirs = [sysconfig .get_path ('include' )]
12
+ if sysconfig .get_path ('platinclude' ) not in dirs :
13
+ dirs .append (sysconfig .get_path ('platinclude' ))
14
+ if get_include () not in dirs :
15
+ dirs .append (get_include ())
16
+ print (' ' .join ('-I' + d for d in dirs ))
17
+
18
+
19
+ def main ():
20
+ parser = argparse .ArgumentParser (prog = 'python -m pybind11' )
21
+ parser .add_argument ('--includes' , action = 'store_true' ,
22
+ help = 'Include flags for both pybind11 and Python headers.' )
23
+ args = parser .parse_args ()
24
+ if not sys .argv [1 :]:
25
+ parser .print_help ()
26
+ if args .includes :
27
+ print_includes ()
28
+
29
+
30
+ if __name__ == '__main__' :
31
+ main ()
You can’t perform that action at this time.
0 commit comments