mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Update VSCode template
Starting with cpptools v0.29 escaped paths in compilerArgs field don't work on Windows.
This commit is contained in:
@ -10,10 +10,6 @@
|
|||||||
% return to_unix_path(text).replace('"', '\\"')
|
% return to_unix_path(text).replace('"', '\\"')
|
||||||
% end
|
% end
|
||||||
%
|
%
|
||||||
% def _escape_required(flag):
|
|
||||||
% return " " in flag and systype == "windows"
|
|
||||||
% end
|
|
||||||
%
|
|
||||||
% def split_args(args_string):
|
% def split_args(args_string):
|
||||||
% return click.parser.split_arg_string(to_unix_path(args_string))
|
% return click.parser.split_arg_string(to_unix_path(args_string))
|
||||||
% end
|
% end
|
||||||
@ -53,10 +49,7 @@
|
|||||||
% def _find_forced_includes(flags, inc_paths):
|
% def _find_forced_includes(flags, inc_paths):
|
||||||
% result = []
|
% result = []
|
||||||
% include_args = ("-include", "-imacros")
|
% include_args = ("-include", "-imacros")
|
||||||
% for f in flags:
|
% for f in filter_args(flags, include_args):
|
||||||
% if not f.startswith(include_args):
|
|
||||||
% continue
|
|
||||||
% end
|
|
||||||
% for arg in include_args:
|
% for arg in include_args:
|
||||||
% inc = ""
|
% inc = ""
|
||||||
% if f.startswith(arg) and f.split(arg)[1].strip():
|
% if f.startswith(arg) and f.split(arg)[1].strip():
|
||||||
@ -66,6 +59,7 @@
|
|||||||
% end
|
% end
|
||||||
% if inc:
|
% if inc:
|
||||||
% result.append(_find_abs_path(inc, inc_paths))
|
% result.append(_find_abs_path(inc, inc_paths))
|
||||||
|
% break
|
||||||
% end
|
% end
|
||||||
% end
|
% end
|
||||||
% end
|
% end
|
||||||
@ -134,8 +128,7 @@
|
|||||||
"compilerPath": "{{ cc_path }}",
|
"compilerPath": "{{ cc_path }}",
|
||||||
"compilerArgs": [
|
"compilerArgs": [
|
||||||
% for flag in [
|
% for flag in [
|
||||||
% '"%s"' % _escape(f) if _escape_required(f) else f
|
% f for f in filter_args(cc_m_flags, ["-m", "-i", "@"], ["-include", "-imacros"])
|
||||||
% for f in filter_args(cc_m_flags, ["-m", "-i", "@"], ["-include", "-imacros"])
|
|
||||||
% ]:
|
% ]:
|
||||||
"{{ flag }}",
|
"{{ flag }}",
|
||||||
% end
|
% end
|
||||||
|
Reference in New Issue
Block a user