From 6caedf8bb1e5fdd249b89b922335c3f7e5c26ba2 Mon Sep 17 00:00:00 2001 From: Jort Band Date: Mon, 23 Dec 2024 19:17:24 +0100 Subject: [PATCH] feat: #209 Added an option to set the amount of concurrent jobs while running make --- CHANGELOG.md | 3 ++- package.json | 6 ++++++ src/BuildTask.ts | 6 +++++- src/Definitions.ts | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b0ce29..6aee6dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,11 @@ ### Added - Issue #206: Did not build anything else than elf files due to the all recipe not being correct. - Issue #212: On Windows threw an error because the build folder was already there. Now checks before using the md command. Thanks to: qwertym88 + - Issue #209: Added an option to set the amount of concurrent jobs while running make ### Fixed - Reverted to single name build instead of a file tree based build output. - - Linkerscript now uses a file for the objects it needs to link to prevent Windows based command line length issues. + - Linkerscript now uses a file for the objects it needs to link to prevent Windows based command line length issues. Fixes issue #210 - Issue #217 when using a number as the target it is converted to a number in the yaml spec. Now convert it to a string to prevent this. ## [3.2.8] - 2024-09-05 diff --git a/package.json b/package.json index b6f96ce..88317ff 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,12 @@ "default": "", "description": "Path to the make executable (e.g. make or ~/usr/bin/make), will use the one in PATH as standard." }, + + "stm32-for-vscode.makeConcurrentJobs": { + "type": "number", + "default": "16", + "description": "The amount of concurrent jobs make is allowed to do." + }, "stm32-for-vscode.armToolchainPath": { "type": "string", "default": "", diff --git a/src/BuildTask.ts b/src/BuildTask.ts index 69f5faa..e5732a8 100644 --- a/src/BuildTask.ts +++ b/src/BuildTask.ts @@ -29,6 +29,7 @@ import * as path from 'path'; import { EXTENSION_CONFIG_NAME, + MAKE_DEFAULT_CONCURRENT_JOBS, makefileName, STM32_ENVIRONMENT_FILE_NAME, } from './Definitions'; @@ -173,7 +174,10 @@ export default async function buildSTM(options?: { flash?: boolean; cleanBuild?: info = await getInfo(currentWorkspaceFolder); await createSTM32EnvironmentFileWhenRequired(info.tools); const makeFlags = info.makeFlags.length > 0 ? ` ${info.makeFlags.join(' ')}` : ''; - const makeArguments = `-j16${makeFlags} -f ${makefileName}`; + const extensionConfiguration = workspace.getConfiguration('stm32-for-vscode'); + const concurrentJobs = extensionConfiguration.get('makeConcurrentJobs', MAKE_DEFAULT_CONCURRENT_JOBS); + + const makeArguments = `-j${concurrentJobs}${makeFlags} -f ${makefileName}`; if (cleanBuild) { try { await executeTask( diff --git a/src/Definitions.ts b/src/Definitions.ts index fed9e41..9449de0 100644 --- a/src/Definitions.ts +++ b/src/Definitions.ts @@ -34,3 +34,4 @@ export const TOOL_SETTINGS = { openOCDInterface: 'openOCDInterface', }; export const GITHUB_ISSUES_URL = 'https://github.com/bmd-studio/stm32-for-vscode/issues'; +export const MAKE_DEFAULT_CONCURRENT_JOBS = 16; \ No newline at end of file