Skip to content

Commit

Permalink
Check if pico-vscode.cmake file exists (#65)
Browse files Browse the repository at this point in the history
Check if pico-vscode.cmake file exists to allow sharing vscode based
projects with others that do not have the extension installed.

Signed-off-by: Jesse Taube <[email protected]>
  • Loading branch information
Mr-Bossman authored Sep 9, 2024
1 parent e9d5465 commit adf88ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion scripts/pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,10 @@ def GenerateCMake(folder, params):
f"set(sdkVersion {params['sdkVersion']})\n"
f"set(toolchainVersion {params['toolchainVersion']})\n"
f"set(picotoolVersion {params['picotoolVersion']})\n"
f"include({cmakeIncPath()})\n"
f"set(picoVscode {cmakeIncPath()})\n"
"if (EXISTS ${picoVscode})\n"
" include(${picoVscode})\n"
"endif()\n"
"# ====================================================================================\n"
)

Expand Down
5 changes: 4 additions & 1 deletion src/utils/cmakeUtil.mts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ export async function cmakeUpdateSDK(
`set(sdkVersion ${newSDKVersion})\n` +
`set(toolchainVersion ${newToolchainVersion})\n` +
`set(picotoolVersion ${newPicotoolVersion})\n` +
`include(${buildCMakeIncPath(false)}/pico-vscode.cmake)\n` +
`set(picoVscode ${buildCMakeIncPath(false)}/pico-vscode.cmake)\n` +
"if (EXISTS ${picoVscode})\n" +
" include(${picoVscode})\n" +
"endif()\n" +
// eslint-disable-next-line max-len
"# ===================================================================================="
);
Expand Down

0 comments on commit adf88ba

Please sign in to comment.