1

I have 2 tasks in my tasks.json. The first is CMAKE which runs correctly. The second is make which depends on the CMAKE being run first. When I use the option dependsOn cmake and run the task make, it only runs the cmake task but no the make task afterwards.

{ "version": "2.0.0", "command": "sh", "args": [ "-c" ], "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "new" }, "tasks": [ { "label": "cmake", "type": "shell", "options": { "cwd": "${workspaceRoot}/build" }, "args": [ "cmake -DCMAKE_BUILD_TYPE=Debug .." ] }, { "label": "make", "type": "shell", "args": [ "make -j8" ], "options": { "cwd": "${workspaceRoot}/build" }, "dependsOn": [ "cmake" ], "group": { "kind": "build", "isDefault": true }, "problemMatcher": [ "$gcc" ] } ] } 

Output of the executed make task:

Executing task: sh -c 'cmake -DCMAKE_BUILD_TYPE=Debug ..' < -- Configuring done -- Generating done -- Build files have been written to: /home/gertjan/multiply/build Press any key to close the terminal. 

1 Answer 1

1

It apparently had something to do with the sh -c at the top of my task. I also changed the args to command in the tasks. My resulting tasks.json file:

{ "version": "2.0.0", "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "new" }, "tasks": [ { "label": "cmake", "type": "shell", "command": "cmake -DCMAKE_BUILD_TYPE=Debug ..", "options": { "cwd": "${workspaceRoot}/build" } }, { "label": "make", "type": "shell", "options": { "cwd": "${workspaceRoot}/build" }, "command": "make -j8", "dependsOn": [ "cmake" ], "group": { "kind": "build", "isDefault": true } } ] } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.