forked from platformio/platformio-core
Add -imacros files to forcedInclude field in VSCode template
This commit is contained in:
@ -52,15 +52,21 @@
|
||||
%
|
||||
% def _find_forced_includes(flags, inc_paths):
|
||||
% result = []
|
||||
% include_args = ("-include", "-imacros")
|
||||
% for f in flags:
|
||||
% inc = ""
|
||||
% if f.startswith("-include") and f.split("-include")[1].strip():
|
||||
% inc = f.split("-include")[1].strip()
|
||||
% elif not f.startswith("-"):
|
||||
% inc = f
|
||||
% if not f.startswith(include_args):
|
||||
% continue
|
||||
% end
|
||||
% if inc:
|
||||
% result.append(_find_abs_path(inc, inc_paths))
|
||||
% for arg in include_args:
|
||||
% inc = ""
|
||||
% if f.startswith(arg) and f.split(arg)[1].strip():
|
||||
% inc = f.split(arg)[1].strip()
|
||||
% elif not f.startswith("-"):
|
||||
% inc = f
|
||||
% end
|
||||
% if inc:
|
||||
% result.append(_find_abs_path(inc, inc_paths))
|
||||
% end
|
||||
% end
|
||||
% end
|
||||
% return result
|
||||
@ -73,7 +79,7 @@
|
||||
% cxx_stds = STD_RE.findall(cxx_flags)
|
||||
% cc_m_flags = split_args(cc_flags)
|
||||
% forced_includes = _find_forced_includes(
|
||||
% filter_args(cc_m_flags, ["-include"]), cleaned_includes)
|
||||
% filter_args(cc_m_flags, ["-include", "-imacros"]), cleaned_includes)
|
||||
%
|
||||
{
|
||||
"configurations": [
|
||||
@ -129,7 +135,7 @@
|
||||
"compilerArgs": [
|
||||
% for flag in [
|
||||
% '"%s"' % _escape(f) if _escape_required(f) else f
|
||||
% for f in filter_args(cc_m_flags, ["-m", "-i", "@"], ["-include"])
|
||||
% for f in filter_args(cc_m_flags, ["-m", "-i", "@"], ["-include", "-imacros"])
|
||||
% ]:
|
||||
"{{ flag }}",
|
||||
% end
|
||||
|
Reference in New Issue
Block a user