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 shipped CMake toolchain definition or, using the
targetpackage, provide a custom CMake toolchain definition. 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.
ToolchainInfo— 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.
Each build approach supports:
Simulink model configuration parameters –– see Configure CMake Build Process and Configure Toolchain (ToolchainInfo) or Template Makefile Build Process.
For information about customizing a build approach, see Code Compilation Customization.
- Configure CMake Build Process
- Create Custom CMake Toolchain Definition
- Configure Toolchain (ToolchainInfo) or Template Makefile Build Process
- Compile Code in Another Development Environment
- Build Library or Executable from AUTOSAR Adaptive Model (AUTOSAR Blockset)