@@ -166,26 +166,29 @@ function _get_std_module_manifest_path(target)
166166 end
167167end
168168
169- function get_stdmodules (target )
169+ function get_stdmodules (target , opt )
170+ opt = opt or {}
170171 if not target :policy (" build.c++.modules.std" ) then
171172 return
172173 end
173174 local modules_json_path = _get_std_module_manifest_path (target )
174- if not modules_json_path then
175- return
176- end
177- local modules_json = json . loadfile ( modules_json_path )
178- if modules_json and modules_json . modules and # modules_json . modules > 0 then
179- local std_module_files = {}
180- local modules_json_dir = path . directory ( modules_json_path )
181- for _ , module_file in ipairs ( modules_json . modules ) do
182- local module_file_path = module_file [ " source- path" ]
183- if not path . is_absolute ( module_file_path ) then
184- module_file_path = path . join ( modules_json_dir , module_file_path )
175+ if modules_json_path then
176+ local modules_json = json . loadfile ( modules_json_path )
177+ if modules_json and modules_json . modules and # modules_json . modules > 0 then
178+ local std_module_files = {}
179+ local modules_json_dir = path . directory ( modules_json_path )
180+ for _ , module_file in ipairs ( modules_json . modules ) do
181+ local module_file_path = module_file [ " source- path" ]
182+ if not path . is_absolute ( module_file_path ) then
183+ module_file_path = path . join ( modules_json_dir , module_file_path )
184+ end
185+ table.insert ( std_module_files , path . normalize ( module_file_path ) )
185186 end
186- table.insert ( std_module_files , path . normalize ( module_file_path ))
187+ return std_module_files
187188 end
188- return std_module_files
189+ 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++" )
189192 end
190193end
191194
0 commit comments