I did some more digging and I think I finally figured it out: https://pastebin.com/JnAFFrhg
Setting up "customLaunchCommand" seems to suppress default behavior of running command line tools by visual studio and I can point it to VS tools bat file and using "customLaunchCommandArgs" I can pass required arguments to it. I will then end up with correct x64 native compiller.
Thank you for your time and answers that eventually led me to figuring this out.
Open Folder project - how to build 64bit version
I am trying to add a task to build my "open folder" project in Visual Studio 2022.
The documentation is about this is quite lacking and I can't figure out how to run my build command with build environment set to x64 architecture and MSVC2017 toolset. So far I didn't even get 64bit version of latest 2022 toolset running, it keeps setting 32bit toolset (and yes, I have 64bit version installed, it works when I use command line prompt directly).
I have following task in my tasks.vs.json:
{
"version": "0.2.1",
"tasks": [
{
"inheritEnvironments": [ "msvc_x64" ],
"taskLabel": "DEBUG - QMake",
"appliesTo": "/",
"type": "launch","command": "${env.QT_64_BIT_PATH}\\bin\\qmake.exe", "args": [ "CONFIG+=debug", "-recursive", "${workspaceRoot}\\All.pro" ], "env": { "VSCMD_DEBUG": "20", "VSCMD_START_DIR": "${workspaceRoot}\\..\\bin_debug_win64_msvc" }, "workingDirectory": "${workspaceRoot}\\..\\bin_debug_win64_msvc" }
}
The VS command line tools are run before the command, I can see the debug output of vscmd. But the host/target is being set to x86 no matter what. I have tried to manually add things like VSCMD_ARG_HOST_ARCH/VSCMD_ARG_TGT_ARCH to environment, but it gets overwritten. I can see in debug output that the vscmd is ran without any argument and thus picking x86 as default. What do I have to set in tasks.vs.json to make it pass "-x64" and "-vcvars_ver=14.29" arguments to the tools init script?
1 answer
Sort by: Most helpful
-
Jaroslav Smid 1 Reputation point
2022-02-17T09:40:04.667+00:00