Skip to content

Commit 3160550

Browse files
author
roman_yakovenko
committed
adding command line utility to generate ctypes wrapper from .dll or .so file
1 parent b029aa1 commit 3160550

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

pygccxml/parser/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from config import config_t
1010
from config import gccxml_configuration_t
1111
from config import load_gccxml_configuration
12+
from config import gccxml_configuration_example
1213

1314
from project_reader import COMPILATION_MODE
1415
from project_reader import project_reader_t

pygccxml/parser/config.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -196,35 +196,37 @@ def raise_on_wrong_settings( self ):
196196

197197
config_t = gccxml_configuration_t #backward computability
198198

199+
gccxml_configuration_example = \
200+
"""[gccxml]
201+
#path to gccxml executable file - optional, if not provided, os.environ['PATH']
202+
#variable is used to find it
203+
gccxml_path=
204+
#gccxml working directory - optional, could be set to your source code directory
205+
working_directory=
206+
#additional include directories, separated by ';' or ':'
207+
include_paths=
208+
#gccxml has a nice algorithms, which selects what C++ compiler to emulate.
209+
#You can explicitly set what compiler it should emulate.
210+
#Valid options are: g++, msvc6, msvc7, msvc71, msvc8, cl.
211+
compiler=
212+
213+
#GCC-XML site: http://gccxml.org/
214+
"""
199215

200216
def load_gccxml_configuration( configuration, **defaults ):
201217
"""loads GCC-XML configuration from a file
202218
203219
Configuration file sceleton:
204220
205221
>>> start <<<
206-
207-
[gccxml]
208-
#path to gccxml executable file - optional, if not provided, os.environ['PATH']
209-
#variable is used to find it
210-
gccxml_path=
211-
#gccxml working directory - optional, could be set to your source code directory
212-
working_directory=
213-
#additional include directories, separated by ';' or ':'
214-
include_paths=
215-
#gccxml has a nice algorithms, which selects what C++ compiler to emulate.
216-
#You can explicitly set what compiler it should emulate.
217-
#Valid options are: g++, msvc6, msvc7, msvc71, msvc8, cl.
218-
compiler=
219-
220-
#GCC-XML site: http://gccxml.org/
221-
222+
223+
%s
224+
222225
>>> end <<<
223226
224-
225227
configuration could be string( configuration file path ) or instance of
226228
ConfigParser.SafeConfigParser class
227-
"""
229+
""" % gccxml_configuration_example
228230
parser = configuration
229231
if isinstance( configuration, types.StringTypes ):
230232
from ConfigParser import SafeConfigParser

pygccxml/utils/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ class native_compiler:
162162
def get_version():
163163
if 'win' not in sys.platform:
164164
return None #not implemented yet
165-
from distutils import msvccompiler
166-
return ( 'msvc', str( msvccompiler.get_build_version() ) )
165+
else:
166+
from distutils import msvccompiler
167+
return ( 'msvc', str( msvccompiler.get_build_version() ) )
167168

168169
@staticmethod
169170
def get_gccxml_compiler():

0 commit comments

Comments
 (0)