简体   繁体   English

您如何控制 Gradle 使用的 (MSVS) VC lib 目录?

[英]How do you control the (MSVS) VC lib directory that Gradle uses?

I have a requirement where there will be two Microsoft Visual Studio builds (providing Visual Compiler) on a single machine, something like:我有一个要求,在一台机器上会有两个 Microsoft Visual Studio 构建(提供 Visual Compiler),例如:

  • C:\VisualStudio\2017\VisualCompiler\SoftwareKit\10\Lib\10.0.10240.0\um\x64 C:\VisualStudio\2017\VisualCompiler\SoftwareKit\10\Lib\10.0.10240.0\um\x64
  • C:\VisualStudio\2017\VisualCompiler\SoftwareKit\10\Lib\10.0.17134.0\um\x64 C:\VisualStudio\2017\VisualCompiler\SoftwareKit\10\Lib\10.0.17134.0\um\x64

(This is how our IT deploys these installs so I cannot really control the layout) (这就是我们的 IT 部署这些安装的方式,所以我无法真正控制布局)

For some Gradle builds (using the cpp-library and cpp-application Gradle plugins) I need to use one directory and for other Gradle builds I need to use the other.对于某些 Gradle 构建(使用 cpp-library 和 cpp-application Gradle 插件)我需要使用一个目录,而对于其他 Gradle 构建我需要使用另一个。

How can I select between these two in my build.gradle scripts?在我的 build.gradle 脚本中,如何在这两者之间进行 select ?

From this post:从这篇文章:

This is the way:这是这样的:

toolChains {
    visualCpp32(VisualCpp) {
        windowsSdkDir winSdkDir32
        installDir visualCppDir32
    }
    visualCpp64(VisualCpp) {
        windowsSdkDir winSdkDir64
        installDir visualCppDir64
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 给定每个静态库定义的导出功能(vc ++ 2008),如何将多个静态链接库合并到单个dll中? - How do you merge multiple static linked libraries into a single dll given each static lib defines exported functionality (vc++ 2008)? 如何使用与MSVS中相同的设置从cmd运行cl.exe? - How do you run cl.exe from cmd using the same settings as in MSVS? 你如何在 VC++ 中使用 put_money? - How do you use put_money in VC++? 如何在VC ++中添加外部库进行编译? - How do you add external libraries for compilation in VC++? VC 2010中的静态库中未链接静态对象。如何强制链接? - Static objects are not being linked in a static lib in VC 2010. How do I force a link? 如何针对发布版本的lib(MSVCRT.lib)构建调试.exe(MSVCRTD.lib)? - How do you build a debug .exe (MSVCRTD.lib) against a release built lib (MSVCRT.lib)? 您如何找到哪个.lib文件与哪个函数一起使用? - How do you find which .lib file goes with which function? 你怎么告诉Qt应用依赖于Qt lib? - How do you tell a Qt app to depend on a Qt lib? 你如何获得程序使用的内存量? - How do you get how much memory a program uses? C ++:如何在使用libcurl的Windows中运行可执行文件? - C++: How do you run an executable in windows that uses libcurl?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM