Comments (6)
其实跟 x86/64 没啥关系,调用 cmake 安装包的时候,已经给 cmake 绑定 x64 的 msvc env 了。。这里的错误是因为,默认那个 ps shell 加的 env 里面 VCInstallDir 这个环境变量是全大写,VCINSTALLDIR
,而 xmake 传给 cmake 的是 VCInstallDir ,导致冲突了。。
也许还有一些其他的 env 也会导致这个问题。。
from xmake.
Bot detected the issue body's language is not English, translate it automatically.
In fact, it has nothing to do with x86/64. When calling the cmake installation package, the msvc env of x64 has already been bound to cmake. . The error here is because, by default, the environment variable VCInstallDir in the env added by the ps shell is all uppercase, VCINSTALLDIR
, and what xmake passes to cmake is VCInstallDir, causing a conflict. .
Maybe there are some other envs that are causing this problem. .
from xmake.
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: “CL.exe”的命令行开关无效。System.ArgumentException: 已添加项。字典中的关键字:“VCINSTALLDIR”所添加的关键字:“VCInstallDir” [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: 在 System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: 在 System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: 在 Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: 在 Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: 在 Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: 在 Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
C:\\Program Files\\Microsoft Visual Studio\\2022\\Preview\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(755,5): error MSB6001: 在 Microsoft.Build.Utilities.ToolTask.Execute() [C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj]
已完成生成项目“C:\\Users\\wangrunqing\\AppData\\Local\\.xmake\\cache\\packages\\2402\\l\\libogg\\v1.3.4\\source\\build_ebbae9da\\CMakeFiles\\3.29.0-rc1\\CompilerIdCXX\\CompilerIdCXX.vcxproj”(默认目标)的操作 - 失败。
from xmake.
这个确实,好像msvc里面就是乱的
不过实际什么情况会有VCInstallDir这个变量出现呢?从vcvarsall,vsdevcmd和developer powershell进去都只有全大写的VCINSTALLDIR
xmake里的相关commit,改过去又改回来了 https://github.com/xmake-io/xmake/pull/1808/files 0a17c9c
from xmake.
看了下issue记录,这两次commit很近,有可能第二次commit 是误改,2021-11-10前后相关issue只有 #1807 ,和module没啥关系;除了VCInstallDir和VSInstallDir这两个,其他变量也没有类似问题
from xmake.
看了下issue记录,这两次commit很近,有可能第二次commit 是误改,2021-11-10前后相关issue只有 #1807 ,和module没啥关系;除了VCInstallDir和VSInstallDir这两个,其他变量也没有类似问题
好多了,我刚测了下,除了这两,还有其他一堆 env 大小写不同 什么 EXTERN_INCLUDE, Framework40Version,有的是 vs promp 大写,有的是大小写。。反正很乱。各种冲突。。
我刚做了兼容修复,目前测下来没问题了,可以完全兼容,你可以试试
from xmake.
Related Issues (20)
- c++20module msvc 支持模块分区实现单元 HOT 34
- 偶现编译失败,重启后成功 HOT 14
- optimize wasi detect HOT 18
- bin2c构建优先级错误 HOT 3
- plugin.compile_commands.autoupdate不会携带预编译header信息 HOT 6
- 安装 Nimble 依赖包报错:fetch nimble::xxx failed! HOT 1
- 交叉编译环境中,Qt找不到uic HOT 10
- Native XCode project generator plugin
- Module object files are not built since v2.8.7 HOT 4
- 添加 target:gb2312 以满足中文兼容性 HOT 5
- 增加能够在 rule 中传递的用户级自定义变量的功能 HOT 5
- 创建 cmakelist 异常 HOT 5
- Support range based glob pattern HOT 5
- add_requireconfs 固定依赖版本后丢失依赖信息 HOT 21
- flex应该能正常单独使用 HOT 3
- package budil with android ndk use cmake_generator=Ninja failed on windows HOT 2
- in package config setting "-DANDROID_PLATFORM=XXX" is override by xmake ndk toolchain HOT 1
- 大型项目用 xmake 构建的最佳实践? HOT 10
- ubuntu下调用xmake f --menu报错error: field 'isdone' is not callable (a nil value) HOT 7
- Allow target:fileconfig() for headerfiles HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmake.