How can I change the rtwbuild option "skipSetupArg"?

3 views (last 30 days)
Georg
Georg on 11 Jan 2023
Answered: Meet on 10 Mar 2023
The build process (command: rtwbuild('model')) generates a model.bat file in Matlab 2022b. Here is an exemplary content:
set skipSetupArg=%2
if "%skipSetupArg%" NEQ "skip_setup_msvc" (
call "setup_msvc.bat"
)
cd .
if "%1"=="" (nmake -f model.mk all) else (nmake -f model.mk %1)
@if errorlevel 1 goto error_exit
exit /B 0
:error_exit
echo The make command returned an error of %errorlevel%
exit /B 1
The file is then automatically executed with the argument "skip_setup_msvc", skipping the corresponding call "setup_msvc". (The full Command Window output is in the text file in the attachment.)
The subsequent command "nmake -f model.mk all" thereby fails and the build process terminates.
In Matlab 2020b there was (as far as I can tell) no such argument.
Is there an option in Matlab to change the argument "skipSetupArg"?
Thank you!

Answers (1)

Meet
Meet on 10 Mar 2023
Yes, you can change the argument "skipSetupArg" by modifying the build settings in MATLAB. Follow the steps below:
  1. Open the Simulink model that you want to build.
  2. Click on the "Modeling" tab in the MATLAB ribbon.
  3. In the "Model Settings" section, click on the "Model Settings" button.
  4. In the "Configuration Parameters" dialog box, select "Code Generation" from the left-hand side list.
  5. In the "Code Generation" section, locate the "Custom Code" pane.
  6. In the "Custom Code" pane, find the "Build command" field.
  7. In the "Build command" field, remove the "skip_setup_msvc" argument and any other arguments that you want to change.
  8. Click on the "Apply" button to save the changes.
  9. Click on the "OK" button to close the dialog box.
After you have modified the build settings, MATLAB should generate the model.bat file with the updated build command, which will include your changes to the skipSetupArg argument.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!