summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-02-08 16:38:18 +0100
committerArthur LAURENT <[email protected]>2024-02-08 16:38:18 +0100
commit0e9efa8d7d982f11603db9ac848770231f9dff75 (patch)
tree48b20a1a77b00131f190bb0d413e8a0e2d351ed5 /xmake/rules/c++/modules/modules_support
parentc11559ee96ac6289713365de62e04ddbbb6be7e0 (diff)
fix find_file for libc++.modules.json when in a subdir
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang/compiler_support.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua b/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua
index fed5cb29d..24915cd04 100644
--- a/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua
+++ b/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua
@@ -209,7 +209,11 @@ function get_stdmodules(target)
-- @see https://github.com/llvm/llvm-project/pull/76451 (has been revert, so we need to wait)
local clang_path = path.directory(get_clang_path(target))
local clang_lib_path = path.join(clang_path, "..", "lib")
- local modules_json_path = find_file("*libc++.modules.json", clang_lib_path)
+ local modules_json_path = find_file("libc++.modules.json", clang_lib_path)
+ -- maybe in subdir
+ if not modules_json_path then
+ modules_json_path = find_file("*/libc++.modules.json", clang_lib_path)
+ end
if modules_json_path then
local modules_json = json.decode(io.readfile(modules_json_path))
local std_module_directory = path.directory(modules_json.modules[1]["source-path"])