Approaches for Building Code Generated from Simulink Models
Use one of these approaches for building (compiling and linking) code that you generate from Simulink® models:
CMake — CMake is 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® and Xcode projects. You can:
Specify a generic CMake toolchain –– see Deploy Component Algorithm as Component Model Library by Using CMake
Specify a shipped CMake toolchain definition –– see Configure CMake Build Process
Provide a custom CMake toolchain definition by using the
targetpackage –– see Create Custom CMake Toolchain Definition.
MATLAB® ships the CMake executable file. Simulink Coder™ and Embedded Coder® support CMake versions from 3.12.0 onwards.
Makefile-based toolchain — The build process generates makefiles and supports custom toolchains. You can define and register custom makefile-based toolchains by using the Target Framework or
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. See Template Makefile Approach.
Each build approach supports:
Simulink model configuration parameters.
External Mode Simulations for Parameter Tuning, Signal Monitoring, and Code Execution Profiling
For information about customizing a build approach, see Code Compilation Customization.
- Deploy Component Algorithm as Component Model Library by Using CMake
- Configure CMake Build Process
- Create Custom CMake Toolchain Definition
- Define Custom Makefile-Based Toolchains Using Target Framework
- Configure Toolchain (ToolchainInfo) or Template Makefile Build Process
- Compile Code in Another Development Environment
- Build Library or Executable from AUTOSAR Adaptive Model (AUTOSAR Blockset)