CLion bug when using VS.NET toolchain
Dear all,
I believed I have found bug in CLion when Visual Studio toolchain is used. BTW, the same behavior happens in versions 2018.2.7 and latest 2018.3.2.
When Visual Studio Toolchain is configured it is possible to specify Platform (store, uwp, onecore). When Platform is selected from the dropdown that offers one of these options (store, uwp, onecore), Visual Studio toolchain setup will fail. The problem is that CLion is passing wrong format for platform_type parameter into vcvarsall.bat. I have printed what CLion is passing when I select 'uwp' as an example in the Platform dropdown and it can be clearly seen:
[DEBUG:vcvarsall.bat] __VCVARSALL_TARGET_ARCH='x64'
[DEBUG:vcvarsall.bat] __VCVARSALL_HOST_ARCH='x64'
[DEBUG:vcvarsall.bat] __VCVARSALL_WINSDK='8.1'
[DEBUG:vcvarsall.bat] __VCVARSALL_STORE='-app_platform=UWP' (!!!)
[DEBUG:vcvarsall.bat] __VCVARSALL_HELP=''
[DEBUG:vcvarsall.bat] __VCVARSALL_PARSE_ERROR='0'
************************************************************
__VCVARSALL_STORE is set to '-app_platform=UWP' string but vcvarsall.bat expects only 'UWP'. Only when Platform dropdown is left empty (user has to explicitly delete text in this field) Visual Studio toolchain will work - it is all because of the wrong format of input passed into __VCVARSALL_STORE which is causing vcvarsall.bat to fail.
BTW, when we are on this subject - can I fix it myself? I mean - is logic of what is passed into toolchain (vcvarsall.bat in our case) hardcoded within CLion or is it stored in some configuration file that can be easily modified? Well, if would be possible to modify vcvarsall.bat to fix this but I would prefer to fix it on CLion side.
I think this is quite minor problem, I am not trying to make drama of it. The only inconvenience was that I spent more then hour to actually resolve this to make my first C++ build though VS toolchain in CLion. So it is more annoyance that this is broken.
Please sign in to leave a comment.
Petr, I'm not sure where this debug output comes from, but CLion doesn't pass `-app_platform` - it just runs `vcvarsall.bat <arch> <platform> <version>` command.
What is the error that you get?
Could you please check the actual command in the CLion's logs? Invoke CLion | Help | Show Logs in File Explorer, open idea.log and locate something like `[INFO] toolchains.MSVC`. There should be a command and the actual result.