StructLayout icon indicating copy to clipboard operation
StructLayout copied to clipboard

Support /external includes

Open ssproessig opened this issue 1 year ago • 3 comments

We use the /external feature to mark any include in brackets as external, so that we can use /W4 for our code, but /W0 for external.

Option enabled with

    /W4 /experimental:external /external:anglebrackets /external:W0

Unfortunately the extension seems not to support this, as the includes for Qt are not taken over

[10:52:41] Capturing configuration from VS projects...
[10:52:41] Looking for structures at <trunc>\IRuntimeModel.h:111:2...
[10:52:41] TOOL ARGUMENTS: -r=111 -c=2 -o=c:\users\ssp\appdata\local\microsoft\visualstudio\17.0_f2cd9b4b\extensions\s1t2a1lc.xo3\Generated\tempResult.slbin -p c:\users\ssp\appdata\local\microsoft\visualstudio\17.0_f2cd9b4b\extensions\s1t2a1lc.xo3\Generated\compile_commands <trunc>\IRuntimeModel.h
[10:52:41] CLANG ARGUMENTS:  -x c++ -m64 -std=c++20 -w -DWIN32 -D_WINDOWS -D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING -DUNICODE -D_UNICODE -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DCMAKE_INTDIR=\"Debug\" -DCore_Extensions_EXPORTS -I<trunc>\sources\application\Libraries -I<trunc>\sources\extensions -I"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include" -I"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\atlmfc\include" -I"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt" -I"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\UnitTest\include" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\cppwinrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8.1\Include\um" -working-directory=F:\2022\aro-vs\sources\extensions\CoreExtensions
In file included from <trunc>\IRuntimeModel.h:5:
<trunc>/api/_ForwardDeclarations.h:5:10: fatal error: 'QHash' file not found
   5 | #include <QHash>
     |          ^~~~~~~
[10:52:42] [ERROR] Unable to scan the given location. (928.0653 ms)

ssproessig avatar Nov 23 '23 10:11 ssproessig

Visual Studio stores them under "Additional Options"

additional_options

ssproessig avatar Nov 23 '23 10:11 ssproessig

Thanks for letting me know. I have never used this feature to be honest. I will run some tests and see if I can retrieve that info from the extension.

What version of the extension are you running on? I made some changes on v0.7.1 so that even if the build fails it will still return a struct in case that build error was not related with the layout.

Viladoman avatar Nov 23 '23 19:11 Viladoman

I'm running the latest version of the addin - and can confirm, that it works, as long as the struct is not using any Qt types

ssproessig avatar Nov 26 '23 08:11 ssproessig