[pygccxml-commit] SF.net SVN: pygccxml:[1494] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2008-12-24 20:47:12
|
Revision: 1494 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1494&view=rev Author: roman_yakovenko Date: 2008-12-24 20:47:08 +0000 (Wed, 24 Dec 2008) Log Message: ----------- few changes to allow introduction of new module builder class Modified Paths: -------------- pyplusplus_dev/environment.py pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.cpp pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.h pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.vcproj pyplusplus_dev/pyplusplus/cpptypes/mydll/release/mydll.dll pyplusplus_dev/pyplusplus/module_builder/__init__.py pyplusplus_dev/pyplusplus/module_builder/builder.py pyplusplus_dev/pyplusplus/module_builder/extension_builder.py pyplusplus_dev/unittests/autoconfig.py Modified: pyplusplus_dev/environment.py =================================================================== --- pyplusplus_dev/environment.py 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/environment.py 2008-12-24 20:47:08 UTC (rev 1494) @@ -49,7 +49,19 @@ boost.libs = ['/home/roman/include/libs' ] boost.include = '/home/roman/boost_svn' python.include = '/usr/include/python2.5' +elif 'root' == getpass.getuser(): + scons.cmd_build = 'scons --file=%s' + scons.cmd_clean = 'scons --clean --file=%s' + + if sys.platform == 'win32': + scons.suffix = '.pyd' + scons.ccflags = ['/MD', '/EHsc', '/GR', '/Zc:wchar_t', '/Zc:forScope', '-DBOOST_PYTHON_NO_PY_SIGNATURES' ] + boost.libs = [ 'd:/dev/boost_svn/bin.v2/libs/python/build/msvc-7.1/release/threading-multi' ] + boost.include = 'd:/dev/boost_svn' + python.libs = 'e:/python25/libs' + python.include = 'e:/python25/include' + _my_path = None try: import environment_path_helper Modified: pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.cpp =================================================================== --- pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.cpp 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.cpp 2008-12-24 20:47:08 UTC (rev 1494) @@ -38,6 +38,9 @@ return std::auto_ptr<number_t>( new number_t( *this ) ); } +void do_smth( number_aptr_t& ){ +} + BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved Modified: pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.h =================================================================== --- pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.h 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.h 2008-12-24 20:47:08 UTC (rev 1494) @@ -9,6 +9,7 @@ virtual ~number_t(); void print_it() const; int get_value() const; + int get_value(){ return m_value; } void set_value(int x); number_t clone() const; @@ -18,3 +19,7 @@ }; template class __declspec(dllexport) std::auto_ptr< number_t >; + +typedef std::auto_ptr< number_t > number_aptr_t; + +void __declspec(dllexport) do_smth( number_aptr_t& ); \ No newline at end of file Modified: pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.vcproj =================================================================== --- pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.vcproj 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/pyplusplus/cpptypes/mydll/mydll.vcproj 2008-12-24 20:47:08 UTC (rev 1494) @@ -118,6 +118,7 @@ RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" DebugInformationFormat="3" /> @@ -134,6 +135,8 @@ Name="VCLinkerTool" LinkIncremental="1" GenerateDebugInformation="true" + GenerateMapFile="true" + MapExports="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" Modified: pyplusplus_dev/pyplusplus/cpptypes/mydll/release/mydll.dll =================================================================== (Binary files differ) Modified: pyplusplus_dev/pyplusplus/module_builder/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/__init__.py 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/pyplusplus/module_builder/__init__.py 2008-12-24 20:47:08 UTC (rev 1494) @@ -13,6 +13,7 @@ """ from extension_builder import extension_module_builder_t as module_builder_t +from ctypes_builder import ctypes_module_builder_t #aliases for functionality located in pygccxml.parser module from pygccxml.parser import COMPILATION_MODE Modified: pyplusplus_dev/pyplusplus/module_builder/builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/builder.py 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/pyplusplus/module_builder/builder.py 2008-12-24 20:47:08 UTC (rev 1494) @@ -13,10 +13,7 @@ """ """ - def __init__( self - , global_ns=None - , encoding='ascii' - , working_directory='.' ): + def __init__( self, global_ns=None, encoding='ascii' ): """ """ object.__init__( self ) @@ -25,8 +22,9 @@ self.__global_ns = global_ns def __get_global_ns( self ): + if not self.__global_ns: + raise RuntimeError( "Reference to global namespace declaration was not set." ) return self.__global_ns - def __set_global_ns( self, global_ns ): self.__global_ns = global_ns Modified: pyplusplus_dev/pyplusplus/module_builder/extension_builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/extension_builder.py 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/pyplusplus/module_builder/extension_builder.py 2008-12-24 20:47:08 UTC (rev 1494) @@ -63,10 +63,7 @@ @param cflags: Raw string to be added to gccxml command line. """ - builder.base_builder_t.__init__( self - , global_ns=None - , encoding=encoding - , working_directory=working_directory ) + builder.base_builder_t.__init__( self, global_ns=None, encoding=encoding ) gccxml_config = parser.config_t( gccxml_path=gccxml_path , working_directory=working_directory @@ -78,10 +75,7 @@ , cflags=cflags , compiler=compiler) - #may be in future I will add those directories to user_defined_directories - #to self.__code_creator. - self.__working_dir = os.path.abspath( working_directory ) - + #may be in future I will add those directories to user_defined_directories to self.__code_creator. self.__parsed_files = map( decls_package.filtering.normalize_path , parser.project_reader_t.get_os_file_names( files ) ) tmp = map( lambda file_: os.path.split( file_ )[0], self.__parsed_files ) @@ -250,11 +244,6 @@ , doc_extractor) self.__code_creator = creator.create() self.__code_creator.replace_included_headers(self.__parsed_files) - #I think I should ask users, what they expect - #self.__code_creator.user_defined_directories.append( self.__working_dir ) - #map( self.__code_creator.user_defined_directories.append - # , self.__parsed_dirs ) - return self.__code_creator @property Modified: pyplusplus_dev/unittests/autoconfig.py =================================================================== --- pyplusplus_dev/unittests/autoconfig.py 2008-12-24 20:44:03 UTC (rev 1493) +++ pyplusplus_dev/unittests/autoconfig.py 2008-12-24 20:47:08 UTC (rev 1494) @@ -23,6 +23,24 @@ import pygccxml +compiler = pygccxml.utils.native_compiler.get_gccxml_compiler() +print 'GCCXML configured to simulate compiler ', compiler +gccxml_version = '__GCCXML_09__' +class cxx_parsers_cfg: + keywd = { 'working_directory' : data_directory + , 'define_symbols' : [ gccxml_version ] + , 'compiler' : compiler + , 'gccxml_path': gccxml.executable } + + if 'win' in sys.platform: + keywd['define_symbols'].append( '__PYGCCXML_%s__' % compiler.upper() ) + if 'msvc9' == compiler: + keywd['define_symbols'].append( '_HAS_TR1=0' ) + + gccxml = pygccxml.parser.gccxml_configuration_t( **keywd ) + + + class scons_config: libs = []#['boost_python'] libpath = [ python.libs ] + boost.libs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |