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):
|
% def _find_forced_includes(flags, inc_paths):
|
||||||
% result = []
|
% result = []
|
||||||
|
% include_args = ("-include", "-imacros")
|
||||||
% for f in flags:
|
% for f in flags:
|
||||||
% inc = ""
|
% if not f.startswith(include_args):
|
||||||
% if f.startswith("-include") and f.split("-include")[1].strip():
|
% continue
|
||||||
% inc = f.split("-include")[1].strip()
|
|
||||||
% elif not f.startswith("-"):
|
|
||||||
% inc = f
|
|
||||||
% end
|
% end
|
||||||
% if inc:
|
% for arg in include_args:
|
||||||
% result.append(_find_abs_path(inc, inc_paths))
|
% 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
|
||||||
% end
|
% end
|
||||||
% return result
|
% return result
|
||||||
@ -73,7 +79,7 @@
|
|||||||
% cxx_stds = STD_RE.findall(cxx_flags)
|
% cxx_stds = STD_RE.findall(cxx_flags)
|
||||||
% cc_m_flags = split_args(cc_flags)
|
% cc_m_flags = split_args(cc_flags)
|
||||||
% forced_includes = _find_forced_includes(
|
% forced_includes = _find_forced_includes(
|
||||||
% filter_args(cc_m_flags, ["-include"]), cleaned_includes)
|
% filter_args(cc_m_flags, ["-include", "-imacros"]), cleaned_includes)
|
||||||
%
|
%
|
||||||
{
|
{
|
||||||
"configurations": [
|
"configurations": [
|
||||||
@ -129,7 +135,7 @@
|
|||||||
"compilerArgs": [
|
"compilerArgs": [
|
||||||
% for flag in [
|
% for flag in [
|
||||||
% '"%s"' % _escape(f) if _escape_required(f) else f
|
% '"%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 }}",
|
"{{ flag }}",
|
||||||
% end
|
% end
|
||||||
|
Reference in New Issue
Block a user