Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.8k views
in Technique[技术] by (71.8m points)

visual studio - Current configuration variable in launch.vs.json

Trying to pass current configuration variable to launch.vs.json. Instead of using x86_64-Debug or x86_64-release in the path

here

"project": "outest_package_buildx86_64-Debuginest_package.exe"

or

"path": "${workspaceRoot}outest_package_buildx86_64-DebugDebug"

I would like to be able to use SOME(?) variable. Is it even possible?

{
  "version": "0.2.1",
  "defaults": {},
  "configurations": [
        {
            "type": "default",
            "project": "out\test_package_build\x86_64-Debug\bin\test_package.exe",
            "projectTarget": "test_package\conanfile.py",
            "name": "test_package.exe",
            "env": {
                "path": "${workspaceRoot}\out\test_package_build\x86_64-Debug\Debug"
            }
        }
  ]
}

I know that in CMakeSettings.json we can use ${name} variable for this purpose.

"configurations": [
        {
            "buildCommandArgs": "-v",
            "buildRoot": "${projectDir}\out\build\${name}",
            "cmakeCommandArgs": "",
            "configurationType": "Debug",
            "ctestCommandArgs": "",
            "generator": "Ninja",
            "inheritEnvironments": [ "msvc_x64" ],
            "installRoot": "${projectDir}\out\install\${name}",
            "name": "x86_64-Debug",
            "variables": [
                {
                    "name": "VERSION",
                    "value": "0.0.0",
                    "type": "STRING"
                },
                {
                    "name": "BUILD_SHARED_LIBS",
                    "value": "TRUE",
                    "type": "BOOL"
                },
                {
                    "name": "USE_CONAN",
                    "value": "TRUE",
                    "type": "BOOL"
                }
            ]
        }
   ]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...