question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clang-build.ps1 vcpkg include for compile_commands.json

See original GitHub issue

Hello, Thanks for the awesome tool! I’m using clang-build.ps1 -export-json command line to generate compile_commands.json for neovim lsp and it works fine except that it doesn’t detect vcpkg so I had to manually include the vcpkg path to the compile_commands.json: -I\"C:\devel\vcpkg\installed\x64-windows\include\" Can we please have an option to force it to include the vcpkg include path if vcpkg is present on the system? Thank you.

Issue Analytics

  • State:closed
  • Created 2 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
IbrahimHindawicommented, Jul 25, 2023

Thank you! Didn’t know I had to activate that. Closing Issue.

1reaction
IbrahimHindawicommented, Jul 24, 2023

@mariru27 No problem, I already have a temporary fix! Thank you very much. Here is some extra information just for clarification: Here is the Clang Power Tools json file output:

[
  {
    "directory": "C:/devel/cgfx/build",
    "command": "\"C:/Program Files/LLVM/bin/clang++.exe\" -x c \"C:/devel/cgfx/thirdparty/glad/src/glad.c\"  -fsyntax-only \"-D_MT\" \"-D_DLL\" \"-DWIN32\" \"-D_WINDOWS\" \"-DCMAKE_INTDIR=/\"Debug/\"\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/cppwinrt\" -I\"C:/devel/cgfx/source\" -I\"C:/devel/cgfx/thirdparty/glad/include\" -I\"C:/devel/cgfx/thirdparty/stb/include\" -I\"C:/devel/cgfx/thirdparty/linmath/include\"",
    "file": "C:/devel/cgfx/thirdparty/glad/src/glad.c"
  }
  ,
  {
    "directory": "C:/devel/cgfx/build",
    "command": "\"C:/Program Files/LLVM/bin/clang++.exe\" -x c \"C:/devel/cgfx/source/main.c\"  -fsyntax-only \"-D_MT\" \"-D_DLL\" \"-DWIN32\" \"-D_WINDOWS\" \"-DCMAKE_INTDIR=/\"Debug/\"\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/cppwinrt\" -I\"C:/devel/cgfx/source\" -I\"C:/devel/cgfx/thirdparty/glad/include\" -I\"C:/devel/cgfx/thirdparty/stb/include\" -I\"C:/devel/cgfx/thirdparty/linmath/include\"",
    "file": "C:/devel/cgfx/source/main.c"
  }
]

Here is the json file after my python script:

[
  {
    "directory": "C:/devel/cgfx/build",
    "command": "\"C:/Program Files/LLVM/bin/clang++.exe\" -x c \"C:/devel/cgfx/thirdparty/glad/src/glad.c\"  -fsyntax-only \"-D_MT\" \"-D_DLL\" \"-DWIN32\" \"-D_WINDOWS\" \"-DCMAKE_INTDIR=/\"Debug/\"\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/cppwinrt\" -I\"C:/devel/cgfx/source\" -I\"C:/devel/cgfx/thirdparty/glad/include\" -I\"C:/devel/cgfx/thirdparty/stb/include\" -I\"C:/devel/cgfx/thirdparty/linmath/include\" -I\"C:/devel/vcpkg/installed/x64-windows/include\"",
    "file": "C:/devel/cgfx/thirdparty/glad/src/glad.c"
  }
  ,
  {
    "directory": "C:/devel/cgfx/build",
    "command": "\"C:/Program Files/LLVM/bin/clang++.exe\" -x c \"C:/devel/cgfx/source/main.c\"  -fsyntax-only \"-D_MT\" \"-D_DLL\" \"-DWIN32\" \"-D_WINDOWS\" \"-DCMAKE_INTDIR=/\"Debug/\"\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/cppwinrt\" -I\"C:/devel/cgfx/source\" -I\"C:/devel/cgfx/thirdparty/glad/include\" -I\"C:/devel/cgfx/thirdparty/stb/include\" -I\"C:/devel/cgfx/thirdparty/linmath/include\" -I\"C:/devel/vcpkg/installed/x64-windows/include\"",
    "file": "C:/devel/cgfx/source/main.c"
  }
]

The only difference is the last include of the “command” item.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · Caphyon/clang-power-tools
"Add LLVM" doesn't work ... compile commands not add vcpkg include path ... clang-build.ps1: append command line args to clang-flags from cpt.config.
Read more >
No compile_commands.json file using cmake with vs code ...
I have a simple hello world int main() {...} in my ../src/ folder. Please suggest to me how to generate the compile_commands.json file...
Read more >
JSON Compilation Database Format Specification - Clang
This document describes a format for specifying how to replay single compilations independently of the build system. Background¶. Tools based on the C++ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found