Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.3k 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...