Add option to not write the dynamic model routines (m|mex).

nodynamic
Stéphane Adjemian (Guts) 2023-12-22 11:49:48 +01:00
parent e32025a76f
commit 94f454cd24
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
3 changed files with 9 additions and 5 deletions

View File

@ -62,7 +62,7 @@ usage()
<< " [json=parse|check|transform|compute] [jsonstdout] [onlyjson] [jsonderivsimple] "
"[nopathchange] [nopreprocessoroutput]"
<< " [mexext=<extension>] [matlabroot=<path>] [onlymodel] [notime] [use_dll] "
"[nocommutativity]"
"[nocommutativity] [nodynamic]"
<< endl;
exit(EXIT_FAILURE);
}
@ -169,6 +169,7 @@ main(int argc, char** argv)
filesystem::path matlabroot;
bool onlymodel = false;
bool use_dll = false;
bool nodynamic = false;
for (auto s : options)
{
@ -426,6 +427,8 @@ main(int argc, char** argv)
use_dll = true;
else if (s == "nocommutativity")
DataTree::setNoCommutativity();
else if (s == "nodynamic")
nodynamic = true;
else
{
cerr << "Unknown option: " << s << endl;
@ -541,7 +544,7 @@ main(int argc, char** argv)
else
mod_file->writeMOutput(basename, clear_all, clear_global, no_warn, console, nograph,
nointeractive, config, check_model_changes, minimal_workspace,
compute_xrefs, mexext, matlabroot, onlymodel, gui, notime);
compute_xrefs, mexext, matlabroot, onlymodel, gui, notime, nodynamic);
/* Ensures that workers are not destroyed before they finish compiling.
Also ensures that the preprocessor final message is printed after the end of

View File

@ -845,7 +845,7 @@ ModFile::writeMOutput(const string& basename, bool clear_all, bool clear_global,
bool console, bool nograph, bool nointeractive, const Configuration& config,
bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string& mexext, const filesystem::path& matlabroot, bool onlymodel,
bool gui, bool notime) const
bool gui, bool notime, bool nodynamic) const
{
if (basename.empty())
{
@ -1165,7 +1165,8 @@ ModFile::writeMOutput(const string& basename, bool clear_all, bool clear_global,
}
}
dynamic_model.writeDynamicFile(basename, use_dll, mexext, matlabroot, false);
if (!nodynamic)
dynamic_model.writeDynamicFile(basename, use_dll, mexext, matlabroot, false);
dynamic_model.writeParamsDerivativesFile<false>(basename);
}

View File

@ -179,7 +179,7 @@ public:
bool console, bool nograph, bool nointeractive, const Configuration& config,
bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string& mexext, const filesystem::path& matlabroot, bool onlymodel,
bool gui, bool notime) const;
bool gui, bool notime, bool nodynamic) const;
void writeJuliaOutput(const string& basename) const;