Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4937

Ubuntu • Re: VS Code Pico extension - switching between debug and release builds

$
0
0
I changed the build configuration in a very hacky way by modifying the 'Raspberry Pi Pico' VS Code extension's source code.

What I did:

1. Opened the extension source file
%USERPROFILE%\.vscode\extensions\raspberry-pi.raspberry-pi-pico-0.17.2\dist\extension.cjs

2. Located the line that runs CMake

Code:

            const command = `${process.env.ComSpec === "powershell.exe" ? "&" : ""}"${cmake}" ${pythonPath.includes("/")                ? `-DPython3_EXECUTABLE="${pythonPath.replaceAll("\\", "/")}" `                : ""}` + `-G Ninja -B ./build "${folder.fsPath}"`;
3. Modified it by adding the CMAKE_BUILD_TYPE (see the second line)

Code:

            const command = `${process.env.ComSpec === "powershell.exe" ? "&" : ""}"${cmake}" ${pythonPath.includes("/")                ? `-DCMAKE_BUILD_TYPE=Debug -DPython3_EXECUTABLE="${pythonPath.replaceAll("\\", "/")}" `                : ""}` + `-G Ninja -B ./build "${folder.fsPath}"`;
4. Restarted VS Code to reload the extension

5. Deleted the 'build' folder to remove the CMake cache

6. Clicked 'Configure CMake'

7. Verified that the file 'build/CMakeCache.txt ' now contains the Debug configuration

Code:

CMAKE_BUILD_TYPE:STRING=Debug

Statistics: Posted by pjanec — Mon Jan 06, 2025 10:51 pm



Viewing all articles
Browse latest Browse all 4937

Trending Articles