Polyspace-configure on a microsoft visual studio project hangs or am I still missing ingredients.
5 次查看(过去 30 天)
显示 更早的评论
The example I am using (some things I found):
"polyspace-configure.exe -lang cpp <MSVS path>/msbuild sample.sln" found at: https://www.mathworks.com/help/codeprover/ug/cannot-create-project-from-visual-studio-build.html?s_tid=srchtitle
- '-lang' is depricated
- MSVS path: putting in the base path of MSVS or any path, does not recognize as a command. So I put in the whole path to devenv.exe, {from putting together this is a call it makes to.}
- '/msbuild' or '/build' Visual studio errors on this
To use "Polyspace-config", I have to go to the path it is located:
C:\Program Files\Polyspace\R2020a\appdata\files\polyspace>
From there I have to use quotes in my command and another set around my path because of spaces:
cmd /C "polyspace-configure.exe "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe" C:\xxx\Source\TRUNK\Systems\DPM\DPM.sln"
Visual Studio opens up and builds the project.
Then the DOS command hangs..
0 个评论
回答(2 个)
Anirban
2020-7-24
Hi Jeremy,
Sorry you landed on this topic with a deprecated option. This will be definitely fixed.
The recommended way to use a Visual Studio build with polyspace-configure is given in Create Project Using Visual Studio Information. It is essentially what you did. If you close the Visual Studio IDE, the polyspace-configure command would also run to completion.
msbuild PathToSolution works in the Visual Studio developer command prompt. In your Windows Start menu, start typing Developer Command Prompt for VS 2017.
Here is a sample command:
polyspace-configure -output-options-file psopts -allow-overwrite msbuild TestProject.vcxproj /t:Rebuild
If you use a regular command prompt, you have to specify the full path to the msbuild executable. The executable would be in a folder like
C:\Windows\Microsoft.NET\Framework\v4.0.30319
2 个评论
Anirban
2020-8-3
编辑:Anirban
2020-8-3
The option -module ensures that a Polyspace options file is created for every executable created (.exe, .dll) in the Visual Studio solution. However, each options file contains source information only for a specific project in the solution. So, there will be a difference in the depth of classes investigated, based on whether the option -module is used or not.
See an example in Modularize Polyspace Analysis by Using Build Command (it is not about Visual Studio, but you will get the idea). Each makefile target in this example is similar to a project in the Visual Studio solution.
Let us say, a VS solution consists of three projects, two projects that lead to two .exe-s and the third one leading to a .dll that will be linked from the two projects. When you run polyspace-configure and build the entire solution:
- If you do not use the option -module, files from all three projects will be added to one options file. You are mixing sources from two different executables.
- If you use the option -module, three separate options files will be created.
The second approach might be sufficient for your needs.
But maybe what you want to do is, using polyspace-configure without -module and -output-options-path, build each project in Visual Studio with its related projects that lead to shared libraries, so that all those files that go into one executable are added to one Polyspace options file.
You can look into Visual Studio documentation on how to do this.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Troubleshoot Compilation Errors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!