Approaches for Building Code Generated from Simulink Models
You can use a CMake, toolchain, or template makefile approach for building (compiling and linking) code that you generate from Simulink® models:
CMake—A third-party, open-source tool for build process management, which uses configuration (CMakeLists.txt) files to generate standard build files for native build environments, for example, makefiles, Ninja files, or Microsoft® Visual Studio® projects. MATLAB® ships the CMake executable file. Simulink Coder™ and Embedded Coder® support CMake versions from 3.12.0 onwards.
Toolchain—The build process generates makefiles and supports custom toolchains. You can control the build process with toolchain information objects that you define by using MATLAB scripts.
Template makefile—The build process uses a template makefile with a toolchain that you specify. Optionally, you can control the build process through a toolchain information object.
This table provides a support summary for each approach.
Feature | CMake | Toolchain | Template Makefile | |
---|---|---|---|---|
codebuild function | Yes | Yes | Yes | |
Simulink model configuration parameters | No | Yes | Yes | |
SIL or PIL simulations with Embedded Coder | No | Yes | Yes |
For information about:
Using the
codebuild
function in each approach, see Compile Code in Another Development Environment.Configuring the toolchain or template makefile build process by using model configuration parameters, see Configure Toolchain or Template Makefile Build Process.
See Also
Related Topics
- Compile Code in Another Development Environment
- Build Library or Executable from AUTOSAR Adaptive Model (AUTOSAR Blockset)
- Configure Toolchain or Template Makefile Build Process