I'm using CMake
for a C++
project. I'm trying to use profile guided optimization
so I need to also pass command line arguments to the Release
mode version of my binary. Visual Studio
needs this to create a performance profile. I already have a launch.vs.json
configuration for the Debug
mode binary with command line arguments:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"name": "MyProject",
"project": "CMakeLists.txt",
"projectTarget": "MyProject.exe",
"type": "default",
"args": [
"...", "..."
]
}
]
}
When I switch to Release
mode and choose the MyProject
startup item, Visual Studio
shows the following error message:
Unable to start debugging. The startup project could not be launched.
Why does it not work that way? I also cannot setup another profile and make Visual Studio
recognize it in Release
mode but it works fine in Debug
mode.