Caphyon / clang-power-tools

Bringing clang-tidy magic to Visual Studio C++ developers.
http://www.clangpowertools.com
Apache License 2.0
489 stars 56 forks source link

compile commands not add vcpkg include path #1115

Closed roachsinai closed 1 year ago

roachsinai commented 2 years ago

My VS vcpkg setting as show below:

image

and on entry in exported compile_commands.json is:

  {
    "directory": "C:/Users/xq/source/repos/YBlaze/",
    "command": "\"C:/Program Files/LLVM/bin/clang++.exe\" -x c++ \"C:/Users/xq/source/repos/YBlaze/YBlaze/utils/LoadFile.cpp\" -std=c++14 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -m32 -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-DWIN32\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-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:/Users/xq/source/repos/YBlaze/packages/Microsoft.ML.OnnxRuntime.Gpu.1.8.1/build/native/../../build/native/include/\"",
    "file": "C:/Users/xq/source/repos/YBlaze/YBlaze/utils/LoadFile.cpp"
  }

and no vcpkg in above line.

Did I miss any setting? Thanks again!

hero101111 commented 2 years ago

Hi,

Apologies about the delayed reply. Clang Power Tools has support for loading VCPKG paths from %LOCALAPPDATA%\vcpkg\vcpkg.user.targets. Did you manage to execute your CPT/vcpkg scenario?

Regads, Gabriel

chaquator commented 2 years ago

Hello, I'm in the same situation. I can share a verbose output of the compilation-db export running for a Visual Studio 2022 project of mine:

--- JSON COMPILATION DATABASE STARTED ---

& : The term 'C:\tools\miniconda3\Scripts\conda.exe' is not recognized as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and 
try again.
At C:\Users\chaq\Documents\WindowsPowerShell\profile.ps1:4 char:4
+ (& "C:\tools\miniconda3\Scripts\conda.exe" "shell.powershell" "hook") ...
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\tools\miniconda3\Scripts\conda.exe:String) [], CommandNotFoundExcept 
   ion
    + FullyQualifiedErrorId : CommandNotFoundException
VERBOSE: Current Clang Power Tools VSIX version: 8.7.0.570
VERBOSE: Loaded assembly C:\Program Files\Microsoft Visual 
Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Build.Utilities.Core.dll
VERBOSE: clang-build.ps1 invocation args: 
  aVcxprojToCompile = C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\MordhauDerpyMod.vcxproj 
  aVcxprojConfigPlatform = Debug|x64 
  aClangCompileFlags = -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas
 -Wno-unused-value 
  Verbose = True 
  aExportJsonDB = True 
  aUseParallelCompile = True 
  aVisualStudioVersion = 2022 
  aSolutionsPath = C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod.sln 
VERBOSE: CPU logical core count: 16
VERBOSE: Scanning for solution files
VERBOSE: Caching solution file \\?\C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod.sln
VERBOSE: Solution full path: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod.sln
VERBOSE: Solution data length: 1430
VERBOSE: Solution file paths:
VERBOSE:   C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod.sln
VERBOSE: 
VERBOSE: Source directory: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\
VERBOSE: Scanning for project files
VERBOSE: Retrieving project list for solution C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod.sln
VERBOSE: Solution directory: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\
VERBOSE: Intermediate solution project matches count: 1
VERBOSE: MordhauDerpyMod\MordhauDerpyMod.vcxproj
VERBOSE: Resolved project paths for solution C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod.sln:
VERBOSE:   C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\MordhauDerpyMod.vcxproj
VERBOSE: 
VERBOSE: Found 1 projects
VERBOSE: PROCESSING ALL PROJECTS
VERBOSE: Trying to load project C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\MordhauDerpyMod.vcxproj
 from cache repository
VERBOSE: Loading project cache repository index
VERBOSE: Checking hash of project file C:\vcpkg\scripts\buildsystems\msbuild\vcpkg.props
VERBOSE: Checking hash of project file C:\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets
VERBOSE: Checking hash of project file C:\Users\chaq\AppData\Local\vcpkg\vcpkg.user.targets
VERBOSE: Checking hash of project file 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\MordhauDerpyMod.vcxproj
VERBOSE: Deleting variables initialized by previous project:
VERBOSE: 
VERBOSE: Loading cached project from C:\Users\chaq\AppData\Roaming\ClangPowerTools\CacheRepository\lOnAGJwdjs.dat
VERBOSE: Cached version of project has 142 variables to load
VERBOSE: SET_VAR HOMEDRIVE: C:
VERBOSE: SET_VAR SolutionDir: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\
VERBOSE: SET_VAR PY_PYTHON: 3.9
VERBOSE: SET_VAR PROCESSOR_LEVEL: 23
VERBOSE: SET_VAR CPT_PROJITEM_ClCompile: System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList
VERBOSE: SET_VAR _ZVcpkgLinkage: 
VERBOSE: SET_VAR MSBuildThisFileExtension: .vcxproj
VERBOSE: SET_VAR COMPUTERNAME: IZUMI-KONATA
VERBOSE: SET_VAR NVTOOLSEXT_PATH: C:\Program Files\NVIDIA Corporation\NvToolsExt\
VERBOSE: SET_VAR ProgramW6432: C:\Program Files
VERBOSE: SET_VAR _ZVcpkgManifestFileLocation: vcpkg.json
VERBOSE: SET_VAR VcpkgRoot: C:\vcpkg
VERBOSE: SET_VAR HOMEPATH: \Users\chaq
VERBOSE: SET_VAR ProgramFiles: C:\Program Files
VERBOSE: SET_VAR _ZVcpkgManifestRoot: 
VERBOSE: SET_VAR CUDA_PATH_V11_4: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4
VERBOSE: SET_VAR PROCESSOR_REVISION: 7100
VERBOSE: SET_VAR VcpkgOSTarget: windows
VERBOSE: SET_VAR OculusBase: C:\Program Files\Oculus\
VERBOSE: SET_VAR VcpkgManifestInstall: true
VERBOSE: SET_VAR MSBuildThisFileName: MordhauDerpyMod
VERBOSE: SET_VAR VULKAN_SDK: C:\VulkanSDK\1.2.182.0
VERBOSE: SET_VAR VcpkgConfiguration: Debug
VERBOSE: SET_VAR ProjectGuid: {70F19637-D2BC-49C9-BE03-A9925B5033AB}
VERBOSE: SET_VAR SystemRoot: C:\windows
VERBOSE: SET_VAR VcpkgPageSchema: C:\vcpkg\scripts\buildsystems\msbuild\vcpkg-general.xml
VERBOSE: SET_VAR _ZVcpkgNormalizedConfiguration: Debug
VERBOSE: SET_VAR NUMBER_OF_PROCESSORS: 16
VERBOSE: SET_VAR ServiceHubLogSessionKey: 1EC8C7EE
VERBOSE: SET_VAR preprocessorDefinitions: "-DUNICODE" "-D_UNICODE" "-D_MT" "-D_DLL" "-D_DEBUG" 
"-DMORDHAUDERPYMOD_EXPORTS" "-D_WINDOWS" "-D_USRDLL" "-D_DEBUG_FUNCTIONAL_MACHINERY"
VERBOSE: SET_VAR TargetName: MordhauDerpyMod
VERBOSE: SET_VAR _ZVcpkgCurrentInstalledDir: x64-windows\
VERBOSE: SET_VAR TMP: C:\Users\chaq\AppData\Local\Temp
VERBOSE: SET_VAR MSBuildProgramFiles32: C:\Program Files (x86)
VERBOSE: SET_VAR LinkIncremental: true
VERBOSE: SET_VAR additionalIncludeDirectories: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\headers\SDK
VERBOSE: SET_VAR MSBuildProjectDirectory: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\
VERBOSE: SET_VAR USERDOMAIN: IZUMI-KONATA
VERBOSE: SET_VAR WindowsTargetPlatformVersion: 10.0
VERBOSE: SET_VAR INTEL_DEV_REDIST: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
VERBOSE: SET_VAR SESSIONNAME: Console
VERBOSE: SET_VAR LOGONSERVER: \\IZUMI-KONATA
VERBOSE: SET_VAR _ZVcpkgInstalledDir: 
VERBOSE: SET_VAR SystemDrive: C:
VERBOSE: SET_VAR VcpkgPlatformTarget: x64
VERBOSE: SET_VAR JAVA_HOME: C:\Program Files\OpenJDK\openjdk-11.0.16_8
VERBOSE: SET_VAR PROCESSOR_IDENTIFIER: AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD
VERBOSE: SET_VAR UseDebugLibraries: true
VERBOSE: SET_VAR MSBuildProjectName: MordhauDerpyMod
VERBOSE: SET_VAR MSBuildThisFileFullPath: 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\MordhauDerpyMod.vcxproj
VERBOSE: SET_VAR PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL
VERBOSE: SET_VAR CPT_PROJITEM_ClInclude: System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList System.Collections.ArrayList
VERBOSE: SET_VAR ChocolateyToolsLocation: C:\tools
VERBOSE: SET_VAR forceIncludeFiles: 
VERBOSE: SET_VAR PSExecutionPolicyPreference: Unrestricted
VERBOSE: SET_VAR VcpkgAutoLink: true
VERBOSE: SET_VAR ProjectDir: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\
VERBOSE: SET_VAR Platform: x64
VERBOSE: SET_VAR _ZVcpkgConfigurationFileLocation: vcpkg-configuration.json
VERBOSE: SET_VAR _ZVcpkgMSBuildStampFile: .msbuildstamp-x64-windows.stamp
VERBOSE: SET_VAR AMDRMPATH: C:\Program Files\AMD\RyzenMaster\
VERBOSE: SET_VAR LOCALAPPDATA: C:\Users\chaq\AppData\Local
VERBOSE: SET_VAR VcpkgManifestRoot: 
VERBOSE: SET_VAR VK_SDK_PATH: C:\VulkanSDK\1.2.182.0
VERBOSE: SET_VAR MSBuildThisFile: MordhauDerpyMod.vcxproj
VERBOSE: SET_VAR PlatformToolset: v143
VERBOSE: SET_VAR ThreadedWaitDialogDpiContext: -4
VERBOSE: SET_VAR VK_LAYER_PATH: C:\VulkanSDK\1.2.182.0\Bin
VERBOSE: SET_VAR VcpkgUseStatic: true
VERBOSE: SET_VAR MSBuildProjectExtension: .vcxproj
VERBOSE: SET_VAR VcpkgPropsImported: true
VERBOSE: SET_VAR VisualStudioDir: C:\Users\chaq\Documents\Visual Studio 2022
VERBOSE: SET_VAR Path: C:\Program 
Files\ImageMagick-7.1.0-Q16-HDRI;C:\Python310\Scripts\;C:\Python310\;C:\Users\chaq\AppData\Roaming\ActiveState\bin;C:\U
sers\chaq\anaconda3;C:\Users\chaq\anaconda3\Scripts;C:\Program 
Files\Oculus\Support\oculus-runtime;C:\VulkanSDK\1.2.182.0\Bin;C:\Program Files (x86)\Common Files\Intel\Shared 
Libraries\redist\intel64\compiler;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;C:\Program Files\NVIDIA 
GPU Computing 
Toolkit\CUDA\v11.4\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShel
l\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\LLVM\bin;C:\Program Files\Microsoft
 VS Code\bin;C:\ProgramData\chocolatey\lib\mpv.install\tools;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL 
Server\130\Tools\Binn\;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build;C:\Program Files 
(x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\CMake\bin;C:\tools\msys64;C:\tools\msys64\mingw64\bin;C:\Program
 Files\NVIDIA Corporation\Nsight Compute 2021.2.1\;C:\tools\cuda\bin;C:\tools\winfetch;C:\Program Files\NVIDIA 
Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program 
Files\Java\jdk1.8.0_211\bin;C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools;C:\Android\android-sdk\t
ools\bin;C:\Users\chaq\Documents\terra-Windows-x86_64-e4ec5d1\bin;C:\Program Files\LOVE;C:\Program Files 
(x86)\gnupg\bin;C:\tools\gsudo\Current;C:\Program Files (x86)\Streamlink\bin;C:\Program Files (x86)\dotnet\;C:\Program 
Files (x86)\Yarn\bin\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\GitHub 
CLI\;C:\Program Files\nodejs\;C:\Program Files\OpenJDK\openjdk-11.0.16_8\bin;C:\Program Files\Streamlink\bin;C:\Program
 Files\Amazon\AWSCLIV2\;C:\Program 
Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program 
Files\Git\cmd;C:\Users\chaq\AppData\Local\Microsoft\WindowsApps;C:\tools\neovim\Neovim\bin;C:\Users\chaq\.dotnet\tools;
C:\Users\chaq\.local\bin;C:\tools\neovim\nvim-win64\bin;C:\Users\chaq\AppData\Local\Yarn\bin;C:\Users\chaq\AppData\Roam
ing\npm;C:\Program Files\MKVToolNix;;C:\Program Files\LLVM\bin
VERBOSE: SET_VAR CLASSPATH: .;
VERBOSE: SET_VAR ANDROID_HOME: C:\Android\android-sdk
VERBOSE: SET_VAR VSLANG: 1033
VERBOSE: SET_VAR projectAllCpps: System.Collections.Hashtable
VERBOSE: SET_VAR MSBuildThisFileDirectory: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\
VERBOSE: SET_VAR VisualStudioEdition: Microsoft Visual Studio Community 2022
VERBOSE: SET_VAR VCProjectVersion: 16.0
VERBOSE: SET_VAR ConfigurationType: DynamicLibrary
VERBOSE: SET_VAR CPT_PROJITEM_PropertyPageSchema: System.Collections.ArrayList
VERBOSE: SET_VAR CPT_PROJITEM__ZVcpkgInstallManifestDependenciesInputs: System.Collections.ArrayList 
System.Collections.ArrayList
VERBOSE: SET_VAR _ZVcpkgConfigSubdir: debug\
VERBOSE: SET_VAR VisualStudioVersion: 17.0
VERBOSE: SET_VAR PROCESSOR_ARCHITECTURE: AMD64
VERBOSE: SET_VAR NVCUDASAMPLES_ROOT: C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.4
VERBOSE: SET_VAR USERDOMAIN_ROAMINGPROFILE: IZUMI-KONATA
VERBOSE: SET_VAR ChocolateyLastPathUpdate: 133062620984609362
VERBOSE: SET_VAR ExternalIncludePath: ;x64-windows\include
VERBOSE: SET_VAR VcpkgEnableManifest: false
VERBOSE: SET_VAR CommonProgramW6432: C:\Program Files\Common Files
VERBOSE: SET_VAR _ZVcpkgExecutable: C:\vcpkg\vcpkg.exe
VERBOSE: SET_VAR APPDATA: C:\Users\chaq\AppData\Roaming
VERBOSE: SET_VAR ALLUSERSPROFILE: C:\ProgramData
VERBOSE: SET_VAR UserRootDir: C:\Users\chaq\AppData\Local\Microsoft\MSBuild\v4.0
VERBOSE: SET_VAR VSAPPIDNAME: devenv.exe
VERBOSE: SET_VAR CharacterSet: Unicode
VERBOSE: SET_VAR FPS_BROWSER_APP_PROFILE_STRING: Internet Explorer
VERBOSE: SET_VAR ProgramFiles(x86): C:\Program Files (x86)
VERBOSE: SET_VAR ProgramData: C:\ProgramData
VERBOSE: SET_VAR ChocolateyInstall: C:\ProgramData\chocolatey
VERBOSE: SET_VAR PUBLIC: C:\Users\Public
VERBOSE: SET_VAR CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
VERBOSE: SET_VAR VSAPPIDDIR: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\
VERBOSE: SET_VAR ProjectStateLine: VcpkgTriplet=x64-windows:
VERBOSE: SET_VAR ProjectName: MordhauDerpyMod
VERBOSE: SET_VAR Keyword: Win32Proj
VERBOSE: SET_VAR VcpkgApplocalDeps: true
VERBOSE: SET_VAR TEMP: C:\Users\chaq\AppData\Local\Temp
VERBOSE: SET_VAR RootNamespace: MordhauDerpyMod
VERBOSE: SET_VAR CPT_PROJITEM_ProjectConfiguration: System.Collections.ArrayList System.Collections.ArrayList 
System.Collections.ArrayList System.Collections.ArrayList
VERBOSE: SET_VAR MIC_LD_LIBRARY_PATH: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic
VERBOSE: SET_VAR PkgDefApplicationConfigFile: 
C:\Users\chaq\AppData\Local\Microsoft\VisualStudio\17.0_64d0189a\devenv.exe.config
VERBOSE: SET_VAR SolutionName: MordhauDerpyMod
VERBOSE: SET_VAR MSBuildLoadMicrosoftTargetsReadOnly: true
VERBOSE: SET_VAR ForceIdentityAuthenticationType: Embedded
VERBOSE: SET_VAR MSBuildProjectFile: MordhauDerpyMod.vcxproj
VERBOSE: SET_VAR ComSpec: C:\windows\system32\cmd.exe
VERBOSE: SET_VAR windir: C:\windows
VERBOSE: SET_VAR _ZVcpkgAppLocalPowerShellCommonArguments: -ExecutionPolicy Bypass -noprofile -File 
"C:\vcpkg\scripts\buildsystems\msbuild\applocal.ps1" "" "x64-windows\debug\bin" "MordhauDerpyMod.write.1u.tlog" 
"vcpkg.applocal.log"
VERBOSE: SET_VAR USERNAME: chaq
VERBOSE: SET_VAR includeDirectories: C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.32.31326\atlmfc\include C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Auxiliary\VS\include C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt 
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um C:\Program Files (x86)\Windows 
Kits\10\Include\10.0.22000.0\shared C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt C:\Program Files 
(x86)\Windows Kits\10\Include\10.0.22000.0\cppwinrt
VERBOSE: SET_VAR MSBuildProjectFullPath: 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\MordhauDerpyMod.vcxproj
VERBOSE: SET_VAR PSModulePath: C:\Users\chaq\Documents\WindowsPowerShell\Modules;C:\Program 
Files\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Modules
VERBOSE: SET_VAR DriverData: C:\Windows\System32\Drivers\DriverData
VERBOSE: SET_VAR _ZVcpkgRoot: C:\vcpkg\
VERBOSE: SET_VAR FPS_BROWSER_USER_PROFILE_STRING: Default
VERBOSE: SET_VAR OS: Windows_NT
VERBOSE: SET_VAR OneDrive: C:\Users\chaq\OneDrive
VERBOSE: SET_VAR itemProperties: System.Collections.Hashtable
VERBOSE: SET_VAR MSBuildToolsVersion: 17.0
VERBOSE: SET_VAR SignInWithHomeTenantOnly: False
VERBOSE: SET_VAR VSSKUEDITION: Community
VERBOSE: SET_VAR CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4
VERBOSE: SET_VAR VCPKG_DEFAULT_TRIPLET: x64-windows
VERBOSE: SET_VAR CommonProgramFiles: C:\Program Files\Common Files
VERBOSE: SET_VAR VcpkgEnabled: true
VERBOSE: SET_VAR USERPROFILE: C:\Users\chaq
VERBOSE: SET_VAR VcpkgTriplet: x64-windows
VERBOSE: SET_VAR NVCUDASAMPLES11_4_ROOT: C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.4
VERBOSE: SET_VAR Configuration: Debug
VERBOSE: Cache repository - project load was successful
PROJECT: C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\MordhauDerpyMod.vcxproj [Debug|x64]
VERBOSE: PCH not enabled for this project!
VERBOSE: Processing 13 cpps
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\kiero\kiero.cpp
VERBOSE: [CONTEXT] item namespace = @(ClCompile)
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\bp_func_name_regsitry.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\mordhau_funcs.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers\find_player_manager.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers\console_manager.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\SE_Translator.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\dllmain.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers\function_tracer_manager.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers\player_info_cache.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers\player_overlay_manager.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers\cheat_manager.cpp
VERBOSE: 
[PCH] Will ignore precompiled headers for 
C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\managers\input_manager.cpp
VERBOSE: INVOKE: C:\Program Files\LLVM\bin\clang++.exe -x c++ 
"C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\MordhauDerpyMod\kiero\kiero.cpp" -std=c++20 -Wall 
-fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value 
-fsyntax-only "-DUNICODE" "-D_UNICODE" "-D_MT" "-D_DLL" "-D_DEBUG" "-DMORDHAUDERPYMOD_EXPORTS" "-D_WINDOWS" "-D_USRDLL"
 "-D_DEBUG_FUNCTIONAL_MACHINERY" -isystem"C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include" -isystem"C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.32.31326\atlmfc\include" -isystem"C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Auxiliary\VS\include" -isystem"C:\Program Files (x86)\Windows 
Kits\10\Include\10.0.22000.0\ucrt" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um" 
Kits\10\Include\10.0.22000.0\ucrt" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um" 
Kits\10\Include\10.0.22000.0\ucrt" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um" 
Kits\10\Include\10.0.22000.0\ucrt" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um" 
-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared" -isystem"C:\Program Files (x86)\Windows 
Kits\10\Include\10.0.22000.0\winrt" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\cppwinrt" 
-I"C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\headers\SDK"

Exported JSON Compilation Database to C:\Users\chaq\Documents\mordhax\MordhauDerpyMod\compile_commands.json
VERBOSE: Cleaning up PCH temporaries:
VERBOSE: 

--- JSON COMPILATION DATABASE FINISHED ---

Ignoring the weird outdated Python path (I hope it's not related to this issue anyway), it can be seen that even though some vcpkg project files get checked early on, no vcpkg paths are included in the includes at the bottom of the output.

Edit: Noticed I was on an older version. I tried again on the latest version 9.1, same results.

MarcelNehring commented 1 year ago

I am also having trouble using clang power tools (version 2023.2.1) with a project that is using vcpkg.

@hero101111 you mentioned that clang powertools can pick up a vcpkg.user.targets file. This, however, is only present in classic mode, AFAIK. When using vcpkg in manifest mode, it seems include directories are determined by _ZVcpkgCurrentInstalledDir from vcpkg.targets.

From my solution: grafik

mariru27 commented 1 year ago

Hi @MarcelNehring,

Thank you for provided information We are looking into it and working towards a fix. I will keep you updated as progress is made.

Best regards, Marina

mariru27 commented 1 year ago

@roachsinai, @MarcelNehring, @chaquator

The fix for this problem is available in release v2023.5.0 for Clang Power Tools

Thank you for your help, means a lot for our product

Have a nice day, Marina

MarcelNehring commented 1 year ago

Hi @mariru27,

thank you and also @hero101111 for working on this issue.

Unfortunately I cannot confirm that the problem is fixed. Include directories for vcpkg are not being added for the clang invocation of CPT.

In the verbose output of CPT I found these two messages. Maybe they are related?

Could not find property sheet \Microsoft.Cpp.Default.props
Could not find property sheet \Microsoft.Cpp.props
hero101111 commented 1 year ago

@MarcelNehring thanks for the update. Those messages from the log are unlikely to be related to the vcpkg issue at hand.

We could use a test project in order to further investigate this...

MarcelNehring commented 1 year ago

@hero101111 thanks for your very quick response. I will try to create a test project to reproduce the issue. This could take me some time, however.

MarcelNehring commented 1 year ago

@hero101111 it took me even longer than expected, sorry for that, but here is a small project that reproduces the issue. To setup vcpkg in manifest mode run the included "setup.bat".

cpt-vcpk-manifest-mode.zip

mariru27 commented 1 year ago

Hi @MarcelNehring,

Thank you for this example, we can reproduce this problem A fix for this issue will be available soon

Kind regards, Marina

mariru27 commented 1 year ago

@MarcelNehring, a fix for this issue is available

You can update manually our scripts, just make sure you have a good connection to internet Go to -> Settings -> Compiler -> PowerShell scripts image

MarcelNehring commented 1 year ago

@mariru27 Wow, thank you so much for this quick fix. I can confirm that it is now working for the example project. :) Unfortunately it is still not working for our real projects. Looking at your fix I suspect that there might exist a similar problem with the $(PlatformToolset) variable? We use a custom triplet that includes not only $(PlatformTarget) but also $(PlatformToolset).

I tried modifying msbuild-project-load.ps1 myself to set it in a similar fashion but it still does not work. Probably I am doing something wrong.

mariru27 commented 1 year ago

In this case @MarcelNehring it may still be a problem from PlatformToolset

Try to set the verbosity level to 3 (from Settings -> Compile) and run compile If you can't give me the full verbose log, check in the output if PlatformTarget value is set correctly, and if the path don't have a typo (VERBOSE: INVOKE: .... -I"path")

MarcelNehring commented 1 year ago

I can only choose between verbosity levels 0, 1 and 2 - not 3. But if I choose 2 it seems that it errors out even in configurations that compile fine with verbosity level 0. At least I cannot find any include path arguments in the output.

However, after some testing it turns out that my guess was wrong and PlatformToolset probably is not the issue.

@mariru27, if you open the previous example project and choose to compile for platform x86 you should be able to reproduce the issue. At least for me it works while compiling for x64 (debug and release) but not for x86 (neither debug nor release).

mariru27 commented 1 year ago

Hi @MarcelNehring, a fix for this issue is available

You can update manually our scripts, just make sure you have a good connection to internet Go to -> Settings -> Compiler -> PowerShell scripts

My bad, you are right, maximum level for verbosity is 2

Kind regards, Marina

MarcelNehring commented 1 year ago

Thank you so much @mariru27! It seems to work now :)

mariru27 commented 1 year ago

I am glad to hear that, @MarcelNehring