Skip to content

Commit e7ca027

Browse files
committed
(C++ modules support) fix warnings for std module
1 parent 7be2041 commit e7ca027

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

xmake/rules/c++/modules/clang/support.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ end
258258

259259
function get_stdmodules(target)
260260

261-
if target:policy("build.c++.modules.std") then
261+
if not target:policy("build.c++.modules.std") then
262262
return
263263
end
264264
local cpplib = _get_cpplibrary_name(target)
@@ -282,14 +282,14 @@ function get_stdmodules(target)
282282
-- dont be greedy and don't enable stdc++ std module support for llvm < 19
283283
local clang_version = get_clang_version(target)
284284
if clang_version and semver.compare(clang_version, "19.0") >= 0 then
285-
return import(".gcc.support").get_stdmodules(target, {dont_warn = true})
285+
return import(".gcc.support").get_stdmodules(target)
286286
end
287287
elseif cpplib == "msstl" then
288288
-- msstl std module file is not compatible with llvm < 19
289289
local clang_version = get_clang_version(target)
290290
if clang_version and semver.compare(clang_version, "19.0") >= 0 then
291291
local toolchain = target:toolchain("llvm") or target:toolchain("clang") or target:toolchain("clang-cl")
292-
return import(".msvc.support").get_stdmodules(target, {dont_warn = false, toolchain = toolchain})
292+
return import(".msvc.support").get_stdmodules(target, {toolchain = toolchain})
293293
end
294294
end
295295
end

xmake/rules/c++/modules/gcc/support.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ function _get_std_module_manifest_path(target)
166166
end
167167
end
168168

169-
function get_stdmodules(target, opt)
170-
opt = opt or {}
169+
function get_stdmodules(target)
171170
if not target:policy("build.c++.modules.std") then
172171
return
173172
end
@@ -187,9 +186,7 @@ function get_stdmodules(target, opt)
187186
return std_module_files
188187
end
189188
end
190-
if not opt.dont_warn then
191-
wprint("std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++")
192-
end
189+
wprint("std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++")
193190
end
194191

195192
function get_bmi_extension()

xmake/rules/c++/modules/msvc/support.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ function get_stdmodules(target, opt)
136136
end
137137
end
138138
end
139-
if not opt.dont_warn then
140-
wprint("std and std.compat modules not found! disabling them for the build")
141-
end
139+
wprint("std and std.compat modules not found! disabling them for the build")
142140
end
143141

144142
function get_bmi_extension()

0 commit comments

Comments
 (0)