xopto.util.build module¶
- build_so_dll(*args, cc: Optional[str] = None, **kwargs) → bool[source]¶
Build a dll or so library using the available native compiles.
- Parameters
args (list) – Positional parameters passed to the DLL / SO build function.
kwargs (dict) – Keyword parameters passed to the DLL / SO build function.
- Returns
res – True on success, else False.
- Return type
bool
- find_mingw() → str[source]¶
Returns the version of installed MINGW compiller or None. If the underlaying OS is 32-bit, only 32-bit compilers are considered, else only 64-bit compilers are considered.
- find_mingw_64(gcc='gcc') → str[source]¶
Returns the version of installed 32-bit MINGW compiller or None.
- find_msvcver(supported: Optional[list] = None, allver: bool = False) → str[source]¶
Find a version of installed MSC build tools.
- Parameters
allver (bool) – If True, all the found versions are returned, else only the highest version is returned.
supported (list) – Optional list of supported MSC build tool versions.
- Returns
ver – A list of found MSC build tools if allver is True, else only the highest found version. Returns [] if no MSC build tools are found.
- Return type
str
- find_msvsver(supported=None, allver=False)[source]¶
Find a version of installed Visual studio tools.
- Parameters
allver (bool) – If True, all the found versions are returned, else only the highest version is returned.
supported (list) – Optional list of supported MSC build tool versions.
- Returns
ver – A list of found Visual Studio installations if allver is True, else only the highest found version. Returns [] if no MSC build tools are found.
- Return type
str
- gcc_build_so_dll(srclist, inclist=None, liblist=None, libdirlist=None, target=None, deflist=None, gcc='gcc', opt='-O2', soname=None, std=None, implib=False, moveto=None, cwd=None, verbose=False, envvars=None, keepscript=False, shell='bash')[source]¶
Builds a DLL (SO) using GCC.
- mingw_build_dll(srclist, inclist=None, liblist=None, libdirlist=None, target=None, deflist=None, ccopts='', gcc='gcc', opt='-O2', std=None, implib=False, moveto=None, cwd=None, verbose=False, envvars=None, keepscript=False)[source]¶
Builds a DLL using MIGW tools.
- msvc_build_dll(srclist, msvcver=None, target=None, ccopts='', inclist=None, deflist=None, libdirlist=None, liblist=None, verbose=False, envvars=None, cwd=None, moveto=None, implib=False, automachine=True, keepscript=False)[source]¶
Builds a DLL using MSC build tools.
- subprocess_cmd(command: list, verbose: bool = False, **kwargs) → str[source]¶
Execute a command using
subprocess.Popen
.- Parameters
command (list) – List of str that represent the command and all the arguments.
verbose (bool) – Turn on verbose reporting.
kwargs (dict) – Keyword arguments passed to
subprocess.Popen.__init__()
.
- Returns
err – Error from stderr if any.
- Return type
str