Main Content

Share Build Configuration Settings

To share build configuration settings among multiple projects or between the MATLAB® Coder™ app and the command line, you can export the settings to and import the settings from a code generation configuration object. You can use a code configuration object when you generate code at the command line by passing the code configuration object to the codegen command with the -config option.

Export App Settings to a Configuration Object

To export app project settings to a code configuration object, use one of these approaches:

  • On the MATLAB Coder app toolstrip, click the Export button and select Export Code Generation Settings. Enter a name for the created configuration object.

  • At the command line, use the -toconfig option with the coder command. If the project file is not in the working directory, you must specify the file path.

The type of configuration object that the app creates depends on the build type of your MATLAB Coder project and on the configuration parameter Use Embedded Coder features.

Build Type SettingParameter SettingCreated Configuration Object
MEXAnycoder.MexCodeConfig
Standalone (static library, dynamic library, or executable) Use Embedded Coder features check box selectedcoder.EmbeddedCodeConfig
Standalone (static library, dynamic library, or executable) Use Embedded Coder features check box clearedcoder.CodeConfig

Import Configuration Object Settings into the App

To import the settings from a code generation configuration object into the MATLAB Coder app, the configuration object must be stored in the base workspace. On the MATLAB Coder toolstrip, click Settings > Import from workspace variable. In the Import Code Generation Settings dialog box, select the configuration object.

See Also

| |

Topics