주요 콘텐츠

생성 코드의 빌드 프로세스 구성하기

생성된 소스 코드의 컴파일 및 링크 사용자 지정

응용 사례에 따라 C/C++ 소스 코드 생성 후(단, 컴파일 전)에 발생하는 빌드 프로세스의 특정 측면을 제어하고자 할 수 있습니다. MATLAB® 코드 내부에서 추가 빌드 파일과 플래그를 지정하려면 coder.updateBuildInfo 함수를 사용하십시오. 또는 작업 공간에서 RTW.BuildInfo 객체를 만들고 이와 연관된 객체 함수를 사용하여 빌드 옵션을 지정하십시오. 외부 코드 통합을 처리하거나 동일한 빌드 정보를 사용하는 함수가 여러 개 있는 경우 coder.ExternalDependency 클래스를 사용하여 빌드 프로세스를 사용자 지정하십시오.

타깃 하드웨어와 빌드 툴 정보를 관리하려면 target 네임스페이스의 클래스를 사용하십시오. 예를 들어, 코드 생성을 위한 새 타깃 하드웨어를 등록하거나, 외부 모드 및 PIL(Processor-in-the-Loop) 시뮬레이션을 위한 연결 대상을 설정하거나, 개발 컴퓨터에서 생성 코드를 빌드하기 위한 사용자 지정 CMake 툴체인 정의를 생성합니다.

함수

모두 확장

coder.updateBuildInfoUpdate RTW.BuildInfo build information object
target.addAdd target object to internal database
target.clearClear all target objects from internal database (R2023a 이후)
target.createCreate target object
target.exportExport target object data
target.getRetrieve target objects from internal database
target.removeRemove target object from internal database
target.updateUpdate target objects in internal database (R2023a 이후)
target.upgradeUpgrade existing definitions of hardware devices
addCompileFlagsAdd compiler options to build information
addDefinesAdd preprocessor macro definitions to build information
addIncludeFilesAdd include files to build information
addIncludePathsAdd include paths to build information
addLinkFlagsAdd link options to build information
addLinkObjectsAdd link objects to build information
addNonBuildFilesAdd nonbuild-related files to build information
addPreincludeFilesAdd preinclude files to build information (R2024a 이후)
addSourceFilesAdd source files to build information
addSourcePathsAdd source paths to build information
addUndefinesAdd undefine preprocessor directives to build information (R2024a 이후)
removeIncludePathsRemove include paths from build information (R2023b 이후)
removeSourceFilesRemove source files from build information object (R2021b 이후)
removeUndefinesRemove undefine preprocessor macros from build information (R2024a 이후)
findBuildArgFind a specific build argument in build information
findIncludeFilesFind and add include (header) files to build information
getBuildArgsGet build arguments from build information
getCompileFlagsGet compiler options from build information
getDefinesGet preprocessor macro definitions from build information
getFullFileListGet list of files from build information
getIncludeFilesGet include files from build information
getIncludePathsGet include paths from build information
getLinkFlagsGet link options from build information
getNonBuildFilesGet nonbuild-related files from build information
getPreincludeFilesGet preinclude files from build information (R2024a 이후)
getSourceFilesGet source files from build information
getSourcePathsGet source paths from build information
getUndefinesFrom build information, get preprocessor macros to undefine (R2024a 이후)
setTargetProvidesMainDisable inclusion of code generator provided (generated or static) main.c source file during build
updateFilePathsAndExtensionsUpdate files in build information with missing paths and file extensions
updateFileSeparatorUpdate file separator character for file lists in build information

객체

RTW.BuildInfo생성 코드를 컴파일하고 링크하기 위한 정보 제공

클래스

coder.ExternalDependencyInterface to external code
target.AliasCreate alternative identifier for target object
target.BuildToolDescribe build tool (R2023a 이후)
target.BuildToolTypeDescribe build tool type (R2023a 이후)
target.CMakeSpecify CMake installation for building generated code (R2022b 이후)
target.CMakeBuilder Configure how CMake builds generated code (R2022b 이후)
target.CMakeBuildTypeDescribe CMake build type or build configuration (R2022b 이후)
target.CMakeCacheEntryConfigure a CMake cache entry (R2022b 이후)
target.EnvironmentConfigurationConfigure system environment for toolchain (R2022b 이후)
target.HardwareComponentSupportDescribe support for a hardware component (R2022b 이후)
target.LanguageImplementationProvide C and C++ compiler implementation details
target.ObjectBase class for target types
target.ProcessorProvide target processor information
target.ToolchainCapture high-level information about toolchain (R2022b 이후)

네임스페이스

target타깃 하드웨어 및 빌드 툴 정보 관리

도움말 항목

추천 예제