diff options
| author | ruki <[email protected]> | 2024-02-09 20:13:35 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-09 20:13:35 +0800 |
| commit | e6fd7cad454f75bea550ecd4783d2c0496684953 (patch) | |
| tree | a52ee0a28b9c07d4296ad8638e952d46dc672ea7 /xmake/rules/c++/modules/modules_support | |
| parent | 0c8646de19a28268d651f954b187120b3319a009 (diff) | |
| parent | 7267466159b053fbd8d71edd2ff735dfe51e7f6d (diff) | |
Merge pull request #4721 from Arthapz/fix-stdmodule-clang
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.lua | 5 |
1 files changed, 4 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..9f581cdca 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,10 @@ 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 = path.join(clang_lib_path, "libc++.modules.json") + if not os.isfile(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"]) |
