Build-Konfiguration
Zum Steuern und Konfigurieren des Build-Prozesses zur Generierung von Binärcode stehen zahlreiche Parameter und Einstellungen zur Verfügung. Diese Einstellungen steuern Attribute wie den Ausgabe-Build-Typ (MEX, lib, dll oder exe) und Verwendung der Sprache C oder C++. Mit anderen Build-Einstellungen können Sie die Build-Ausgabe an bestimmte Anforderungen wie Lesbarkeit, Leistung und Integration von externem Code anpassen. Sie können die Build-Optionen im Konfigurationsobjekt für die Codegenerierung über die App oder über die Befehlszeile ändern. Das Konfigurationsobjekt erstellen Sie mithilfe von coder.config
. Öffnen Sie das Objekt in der Bearbeitungs-App mit open
. Verwenden Sie coder.updateBuildInfo
, um weitere Build-Dateien und Flags aus dem Funktionscode festzulegen.
Funktionen
Einstellungen für die Code-Konfiguration
Objekte
coder.MexCodeConfig | Configuration parameters for MEX function generation from MATLAB code |
coder.CodeConfig | Configuration parameters for C/C++ code generation from MATLAB code |
coder.EmbeddedCodeConfig | Configuration parameters for C/C++ code generation from MATLAB code with Embedded Coder |
coder.HardwareImplementation | Hardware-specific configuration parameters for C/C++ code generation from MATLAB code |
coder.hardware | Create hardware board configuration object for C/C++ code generation from MATLAB code |
coder.ReplacementTypes | Configuration parameter to specify custom names for MATLAB built-in data types in C/C++ code generation |
RTW.BuildInfo | Provide information for compiling and linking generated code |
Klassen
coder.ExternalDependency | Interface to external code |
target.Alias | Create alternative identifier for target object |
target.CMake | Specify CMake installation for building generated code (Seit R2022b) |
target.CMakeBuilder | Configure how CMake builds generated code (Seit R2022b) |
target.CMakeBuildType | Describe CMake build type or build configuration (Seit R2022b) |
target.CMakeCacheEntry | Configure a CMake cache entry (Seit R2022b) |
target.EnvironmentConfiguration | Configure system environment for toolchain (Seit R2022b) |
target.HardwareComponentSupport | Describe support for a hardware component (Seit R2022b) |
target.LanguageImplementation | Provide C and C++ compiler implementation details |
target.Object | Base class for target types |
target.Processor | Provide target processor information |
target.Toolchain | Capture high-level information about toolchain (Seit R2022b) |
Namespaces
target | Manage target hardware and build tool information |
Themen
Grundlagen der Build-Konfiguration
- Configure Code Generation and Build Settings
Configure code generation and build configuration parameters at the command line or in the MATLAB® Coder™ app. - Build Process Customization
Control aspects of the build process that occur after code generation but before compilation. - Paths and File Infrastructure Setup
Specify location of custom code. - Build Process Support for File and Folder Names
Troubleshoot build process errors that occur when file system issues prevent file processing. - Share Build Configuration Settings
Export project settings to a code generation configuration object or import the settings into a project. - Specify Code Configuration Parameters Interactively
Configure the code generation process by using the Code Generation Settings dialog box. - C Compiler Considerations for Signed Integer Overflows
For accurate results from signed integer C operations, the C compiler must preserve wrap-on-overflow behavior. - Requirements for Signed Integer Representation
Compile generated code on a target that uses a two’s complement representation for signed integer values.
Spezifische Build-Optionen
- Preserve Variable Names in Generated Code
Improve readability of generated C/C++ code by preserving your variable names in the generated code. - Understand and Control Partitioning of the Generated Code
Understand how file partitioning method and inlining settings interact to control the partitioning of the generated code. - Change Language Standard Used for Code Generation
The code generator uses the language standard that you specify in the build settings. - Register New Hardware Devices
Extend the range of supported hardware by registering new devices. - Configure CMake Build Process
Specify CMake toolchain definition for building generated code. - Create Custom CMake Toolchain Definition
CMake is a third-party, open-source tool for build process management. - Constant Input Checking in MEX Functions
Control whether a MEX function checks the value of a constant input argument.
Fehlerbehebung
- Compiler- und Linker-Fehler
Beheben üblicher Ursachen von Fehlern während des Builds.