Comments (3)
Hello and thank you ;)
Adding new common switches to Makefile or 'make' command is generally not a good idea - someone might have a different configuration/CPU, different hardware or simply don't want this switch. In case of -jX
command, X is number-of-cores-specific switch, meaning: I might have only 2 cores, while you have 4. I don't know what exactly will happen if this switch is not properly configured. So, no, this will not be added.
Anyway, there are other simple solutions for your request:
-
Manually modify generated tasks.json file in .vscode subfolder.
Search for Build project task and find:"args": [ ]
field. Simply add your custom switches there, in your case this would be"-j12"
added after"GCC_PATH=...",
field.
NOTE: This will be overwritten with next ideScripts update ('Update workspace' task). -
Generate new build task.
Just copy entire Build project task, rename it and add argument as described above.
NOTE: This task will NOT be overwritten on 'Update workspace' task. However, if something goes wrong (aka bad settings in any of other json files), your task will be overwritten (but stored in .backup files). -
Modify task generator script.
Find updateTasks.py and search fordef getBuildTask(self)
function. At the bottom of this function, you can find:
jsonTaskData["args"] = ["GCC_PATH=" + gccFolderPath]
Just add your custom argument in the same manner:
jsonTaskData["args"] = ["-j12"]
NOTE: 'Make' command will be updated on 'Update workspace' task. This option will only be re-set to default on ideScript files update (eg.: future updates from this GitHub repository).
from vs-code-stm32-ide.
Well, yeah, the -j12 is useful for my work pc and home pc, but I can't imagine you can't just add some detection.
Heck I whipped up python and executed two commands.
Adding more threads than there are available simply does nothing. Or, well, it might every so slightly degrade it.
The only true problem I could see by adding this function is that for some reason some code may not be compiled in parallel, but I've never had that problem with embedded code for the ST at least.
from vs-code-stm32-ide.
After a short break, I decided to give it a try and I have implemnted this feature.
Added '-jX' switch, where X is NUMBER OF CORES *1.5. 1.5 number is advised on many GNU make forum posts, so I go with this number.
On my 4-core PC there is not that much difference in time (about 20%), but I agree that every second you have must wait is a wasted second.
Update your ideScripts.
from vs-code-stm32-ide.
Related Issues (20)
- Invalid path detected in 'buildData.json' 'stm32SvdPath' key HOT 9
- how to install HOT 4
- Building issue HOT 6
- .vscode cfg file not found by openocd HOT 3
- GDB not found HOT 2
- Error when Flashing HOT 1
- GNU eclipse tools, GNU Eclipse ARM Embedded GCC: 7-2018-q2 not available HOT 3
- Problem with FreeRTOS HOT 2
- Maybe I got a bug. HOT 4
- Problem with access (seemingly) when executing update.py HOT 8
- Update.py Run Error HOT 1
- Error (unrecoverable) Unable to find matching STM32 CPU name for Keil project device: STM32L072CTx HOT 2
- Install on Mac OS HOT 1
- gccExePath HOT 2
- Paths with spaces HOT 2
- IndexError: list index out of range HOT 1
- Make file missing seprator HOT 1
- PermissionError: [WinError 5] Access is denied HOT 1
- Try build and get this: "undefined reference to .... HOT 2
- update.py generates bad arguments for openocd HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vs-code-stm32-ide.