I have a Visual Studio Code
tasks.json
file to run a C++
file via g++
:
{
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "g++",
"args": [
"-I ~/vcpkg/installed/x64-osx/include/",
"test.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
The problem is the resulting command > Executing task: g++ '-I ~/vcpkg/installed/x64-osx/include/' test.cpp <
has single quotes so that won't work.
I took a look here and tried this:
{
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "g++",
"args": [
{
"value": "-I ~/vcpkg/installed/x64-osx/include/",
"quoting": "escape"
},
"test.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
The problem is the resulting command> Executing task: g++ -I\ ~/vcpkg/installed/x64-osx/include/ test.cpp <
uses escape
so has a \
.
How can I generate the desired command:
g++ -I ~/vcpkg/installed/x64-osx/include/ test.cpp