From 7b763614871012e9184dd4a76b42d49aad23066b Mon Sep 17 00:00:00 2001 From: "Brian A. Ignacio" Date: Thu, 10 Feb 2022 15:47:07 +0800 Subject: [PATCH] add ccache enable logic to sdk config editor (#637) --- src/espIdf/menuconfig/confServerProcess.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/espIdf/menuconfig/confServerProcess.ts b/src/espIdf/menuconfig/confServerProcess.ts index af6fd82aa..4650e79c1 100644 --- a/src/espIdf/menuconfig/confServerProcess.ts +++ b/src/espIdf/menuconfig/confServerProcess.ts @@ -170,9 +170,15 @@ export class ConfserverProcess { const idfPyPath = path.join(guiconfigEspPath, "tools", "idf.py"); const modifiedEnv = appendIdfAndToolsToPath(); const pythonBinPath = idfConf.readParameter("idf.pythonBinPath") as string; + const enableCCache = idfConf.readParameter("idf.enableCCache") as boolean; + const reconfigureArgs: string[] = [idfPyPath]; + if (enableCCache) { + reconfigureArgs.push("--ccache") + } + reconfigureArgs.push("-C", currWorkspace.fsPath, "reconfigure"); const getSdkconfigProcess = spawn( pythonBinPath, - [idfPyPath, "-C", currWorkspace.fsPath, "reconfigure"], + reconfigureArgs, { env: modifiedEnv } ); @@ -267,9 +273,15 @@ export class ConfserverProcess { process.env.PYTHONUNBUFFERED = "0"; const idfPath = path.join(this.espIdfPath, "tools", "idf.py"); const modifiedEnv = appendIdfAndToolsToPath(); + const enableCCache = idfConf.readParameter("idf.enableCCache") as boolean; + const confServerArgs: string[] = [idfPath]; + if (enableCCache) { + confServerArgs.push("--ccache") + } + confServerArgs.push("-C", workspaceFolder.fsPath, "confserver"); this.confServerProcess = spawn( pythonBinPath, - [idfPath, "-C", workspaceFolder.fsPath, "confserver"], + confServerArgs, { env: modifiedEnv } ); ConfserverProcess.progress.report({