forked from platformio/platformio-core
Fix incorrect handling of C/C++ standards passed via build_flags
This commit is contained in:
@ -46,12 +46,14 @@
|
|||||||
"intelliSenseMode": "clang-x64",
|
"intelliSenseMode": "clang-x64",
|
||||||
% import re
|
% import re
|
||||||
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
|
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
|
||||||
|
% cc_stds = STD_RE.findall(cc_flags)
|
||||||
|
% cxx_stds = STD_RE.findall(cxx_flags)
|
||||||
%
|
%
|
||||||
% if STD_RE.search(cc_flags):
|
% if cc_stds:
|
||||||
"cStandard": "c{{ STD_RE.search(cc_flags).group(1) }}",
|
"cStandard": "c{{ cc_stds[-1] }}",
|
||||||
% end
|
% end
|
||||||
% if STD_RE.search(cxx_flags):
|
% if cxx_stds:
|
||||||
"cppStandard": "c++{{ STD_RE.search(cxx_flags).group(1) }}",
|
"cppStandard": "c++{{ cxx_stds[-1] }}",
|
||||||
% end
|
% end
|
||||||
"compilerPath": "{{ cc_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') }}"
|
"compilerPath": "{{ cc_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') }}"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user