Skip to content

(cmake) fix default flags detection on windows platform#6619

Merged
waruqi merged 2 commits intoxmake-io:devfrom
Arthapz:fix-cmake-clang-windows
Jul 14, 2025
Merged

(cmake) fix default flags detection on windows platform#6619
waruqi merged 2 commits intoxmake-io:devfrom
Arthapz:fix-cmake-clang-windows

Conversation

@Arthapz
Copy link
Member

@Arthapz Arthapz commented Jul 11, 2025

when using llvm or clang toolchain on windows platform and using --sdk instead of having clang in PATH env var, xmake fail to get correct default c and cxx flags when installing a package using CMake, this patch fix it

@Arthapz Arthapz changed the title (cmake) fix default flags detection when using clang or clang-cl on w… (cmake) fix default flags detection on windows platform Jul 11, 2025
@Arthapz Arthapz force-pushed the fix-cmake-clang-windows branch from dbc36fc to 77c1120 Compare July 11, 2025 20:12
@Arthapz Arthapz force-pushed the fix-cmake-clang-windows branch from 77c1120 to 5005dd9 Compare July 11, 2025 20:13
-- The default flags are different for different platforms
-- @see https://github.com/xmake-io/xmake-repo/pull/4038#issuecomment-2116489448
local cachekey = buildtype .. package:plat() .. package:arch()
local cachekey = buildtype .. package:plat() .. package:arch() .. package:build_getenv("cc") .. package:build_getenv("cxx")
Copy link
Member

Choose a reason for hiding this comment

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

local cc = package:build_getenv("cc")

@waruqi waruqi merged commit f2cbab0 into xmake-io:dev Jul 14, 2025
20 of 22 checks passed
@waruqi waruqi added this to the v3.0.1 milestone Jul 14, 2025
@Arthapz Arthapz deleted the fix-cmake-clang-windows branch September 18, 2025 09:23
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