Giter VIP home page Giter VIP logo

Comments (6)

waruqi avatar waruqi commented on August 28, 2024

其实跟 x86/64 没啥关系,调用 cmake 安装包的时候,已经给 cmake 绑定 x64 的 msvc env 了。。这里的错误是因为,默认那个 ps shell 加的 env 里面 VCInstallDir 这个环境变量是全大写,VCINSTALLDIR ,而 xmake 传给 cmake 的是 VCInstallDir ,导致冲突了。。

也许还有一些其他的 env 也会导致这个问题。。

from xmake.

Issues-translate-bot avatar Issues-translate-bot commented on August 28, 2024

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.

waruqi avatar waruqi commented on August 28, 2024
  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.

xq114 avatar xq114 commented on August 28, 2024

这个确实,好像msvc里面就是乱的
image
image
不过实际什么情况会有VCInstallDir这个变量出现呢?从vcvarsall,vsdevcmd和developer powershell进去都只有全大写的VCINSTALLDIR

xmake里的相关commit,改过去又改回来了 https://github.com/xmake-io/xmake/pull/1808/files 0a17c9c

from xmake.

xq114 avatar xq114 commented on August 28, 2024

看了下issue记录,这两次commit很近,有可能第二次commit 是误改,2021-11-10前后相关issue只有 #1807 ,和module没啥关系;除了VCInstallDir和VSInstallDir这两个,其他变量也没有类似问题

from xmake.

waruqi avatar waruqi commented on August 28, 2024

看了下issue记录,这两次commit很近,有可能第二次commit 是误改,2021-11-10前后相关issue只有 #1807 ,和module没啥关系;除了VCInstallDir和VSInstallDir这两个,其他变量也没有类似问题

好多了,我刚测了下,除了这两,还有其他一堆 env 大小写不同 什么 EXTERN_INCLUDE, Framework40Version,有的是 vs promp 大写,有的是大小写。。反正很乱。各种冲突。。

我刚做了兼容修复,目前测下来没问题了,可以完全兼容,你可以试试

#4759

from xmake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.