Skip to content
Snippets Groups Projects
Commit a57c8b38 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

MEX/Compilation: added defines field


Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@665 4c865b51-4357-4376-afb4-474e03ccb993
parent c41d4398
No related branches found
No related tags found
No related merge requests found
......@@ -54,5 +54,12 @@
<lib>z</lib>
</libraries>
</file>
<file>
<path>zUtil_Cxx/gtImgMeanValue.cpp</path>
<preprocessor>
<define>HAVE_OMP</define>
</preprocessor>
</file>
</mex_files>
</config>
......@@ -44,7 +44,7 @@ class MexBuilder(object):
print('File: ' + file_name + ' ( ' + self.c_files[file_name] + ' )')
print('')
def _buildMakeCmd(self, cmd, includes, lib_paths, libs, verbose):
def _buildMakeCmd(self, cmd, includes, lib_paths, libs, defines, verbose):
if verbose is True:
cmd.append('-v')
for include in includes:
......@@ -53,6 +53,8 @@ class MexBuilder(object):
cmd.append("-L" + lib_path)
for lib in libs:
cmd.append("-l" + lib)
for define in defines:
cmd.append("-D" + define)
print('\n file: ' + cmd[1] + ' (cmd: ' + string.join(cmd, ' ') + ' )')
subprocess.call(cmd)
......@@ -70,7 +72,7 @@ class MexBuilder(object):
if self.mex_info is None:
# No info at all into the xml file
print("\nWarning: Mex info not loaded.")
self._buildMakeCmd(cmd, std_include, [], [], verbose)
self._buildMakeCmd(cmd, std_include, [], [], [], verbose)
else:
if self.mex_info.isExcluded(file_path) is False:
props = self.mex_info.getFileProperties(file_path)
......@@ -78,11 +80,12 @@ class MexBuilder(object):
includes = std_include + props.get("includes")
self._buildMakeCmd(cmd, includes,
props.get("lib_paths"),
props.get("libs"), verbose)
props.get("libs"),
props.get("defines"), verbose)
else:
# info found, but not about this file, so let's use standard params
print("\nWarning: No Mex info on file: '" + file_name + "'")
self._buildMakeCmd(cmd, std_include, [], [], verbose)
self._buildMakeCmd(cmd, std_include, [], [], [], verbose)
def compileFuncs(self, mfiles_to_consider, force_compile, verbose):
"""
......
......@@ -78,6 +78,10 @@ class MexConf(object):
for lib in fileEntry.findall("libraries/lib"):
output["libs"].append(lib.text)
output["defines"] = []
for lib in fileEntry.findall("preprocessor/define"):
output["defines"].append(lib.text)
return output
else:
return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment