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

Conf: Added configuration options (for matlab/mex)

parent c58cf758
No related branches found
No related tags found
No related merge requests found
...@@ -103,6 +103,9 @@ ...@@ -103,6 +103,9 @@
<lib>mysqlclient</lib> <lib>mysqlclient</lib>
<lib>z</lib> <lib>z</lib>
</libraries> </libraries>
<preprocessor>
<option>-compatibleArrayDims</option>
</preprocessor>
</file> </file>
<file> <file>
......
...@@ -141,7 +141,7 @@ class MexBuilder(object): ...@@ -141,7 +141,7 @@ class MexBuilder(object):
self.out.printSubSubJob('File', file_name + ' ( ' + self.c_files[file_name] + ' )') self.out.printSubSubJob('File', file_name + ' ( ' + self.c_files[file_name] + ' )')
print('') print('')
def _buildMakeCmd(self, cmd, includes, lib_paths, libs, defines): def _buildMakeCmd(self, cmd, includes, lib_paths, libs, defines, options):
if self.out.verboseLevel > 1: if self.out.verboseLevel > 1:
cmd.append('-v') cmd.append('-v')
if self.debug is True: if self.debug is True:
...@@ -155,6 +155,10 @@ class MexBuilder(object): ...@@ -155,6 +155,10 @@ class MexBuilder(object):
cmd.append("-l" + lib) cmd.append("-l" + lib)
for define in defines: for define in defines:
cmd.append("-D" + define) cmd.append("-D" + define)
for option in options:
cmd.append(option)
if "-compatibleArrayDims" not in options:
cmd.append("-largeArrayDims")
# cmd.append("-largeArrayDims") # This unfortunately conflicts with mym.cpp # cmd.append("-largeArrayDims") # This unfortunately conflicts with mym.cpp
self.out.printSubSubJob('File', cmd[1] + ' (cmd: ' + string.join(cmd, ' ') + ' )') self.out.printSubSubJob('File', cmd[1] + ' (cmd: ' + string.join(cmd, ' ') + ' )')
return subprocess.call(cmd) return subprocess.call(cmd)
...@@ -172,6 +176,7 @@ class MexBuilder(object): ...@@ -172,6 +176,7 @@ class MexBuilder(object):
lib_paths = [] lib_paths = []
libs = [] libs = []
defines = [] defines = []
options = []
if (self.mex_info is not None) \ if (self.mex_info is not None) \
and (self.mex_info.isExcluded(file_path) is False): and (self.mex_info.isExcluded(file_path) is False):
...@@ -183,8 +188,9 @@ class MexBuilder(object): ...@@ -183,8 +188,9 @@ class MexBuilder(object):
lib_paths = lib_paths + props.get("lib_paths") lib_paths = lib_paths + props.get("lib_paths")
libs = libs + props.get("libs") libs = libs + props.get("libs")
defines = defines + props.get("defines") defines = defines + props.get("defines")
options = options + props.get("options")
return self._buildMakeCmd(cmd, includes, lib_paths, libs, defines) return self._buildMakeCmd(cmd, includes, lib_paths, libs, defines, options)
def compileFuncs(self): def compileFuncs(self):
""" """
......
...@@ -189,6 +189,10 @@ class MexConf(object): ...@@ -189,6 +189,10 @@ class MexConf(object):
for lib in fileEntry.findall("preprocessor/define"): for lib in fileEntry.findall("preprocessor/define"):
output["defines"].append(lib.text) output["defines"].append(lib.text)
output["options"] = []
for lib in fileEntry.findall("preprocessor/option"):
output["options"].append(lib.text)
return output return output
else: else:
return None 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