Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cmake): Set correct c++ compiler and detect ninja for MinGW #5520

Closed
wants to merge 1 commit into from

Conversation

24bit-xjkp
Copy link
Contributor

  1. Set clang++ and g++ first since we use the first c++ compiler in the toolchain to build the package
  2. Try to detect ninja when use a toolchain without mingw
  3. see MinGW平台上cmake包编译问题 #5518

1. Set clang++ and g++ first since we use the first c++ compiler in the toolchain to build the package
2. Try to detect ninja when use a toolchain without mingw
3. see xmake-io#5518
set_toolset("cc", "clang" .. suffix)
set_toolset("cxx", "clang" .. suffix, "clang++" .. suffix)
set_toolset("cxx", "clang++" .. suffix, "clang" .. suffix)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要改这。影响太大。。

-- When we are using a standalone clang/gcc toolchain without mingw, try to detect ninja automatically.
-- see:https://github.com/xmake-io/xmake/issues/5518
local mingw = package:build_getenv("mingw") or package:build_getenv("sdk") or ""
mingw = find_tool(mingw, {paths = mingw})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怪怪的,目前 xmake f -p mingw 的约定就是强制使用 mingw 工具链,如果 mingw 都找不到,应该直接 break 报错 mingw not found 。。压根到不了这。。

而且 find_tool 里串传 mingw path 。。怎么能 find 的到

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主要是Windows用clang-cl和msvc,而cross又有好多包不支持,改包描述也是个大工程,就用了mingw平台

find_tool写错了,应该是mingw/bin下找mingw32-make.exe

@waruqi
Copy link
Member

waruqi commented Aug 28, 2024

#5521

@waruqi waruqi closed this Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants