diff --git a/HISTORY.rst b/HISTORY.rst index a0ac578b32..c5fff09423 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,7 @@ PlatformIO Core 5 - Fixed an issue when using a custom git/ssh package with `platform_packages `__ option (`issue #3624 `_) - Fixed an issue with "ImportError: cannot import name '_get_backend' from 'cryptography.hazmat.backends'" when using `Remote Development `__ on RaspberryPi device (`issue #3652 `_) +- Fixed an issue with incorrect value for C++ language standard in IDE projects when an in-progress language standard is used (`issue #3653 `_) 5.0.0 (2020-09-03) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl index a974ee4fe7..dc03b2e5c8 100644 --- a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl @@ -63,7 +63,7 @@ SET(CMAKE_CXX_COMPILER "{{ _normalize_path(cxx_path) }}") SET(CMAKE_CXX_FLAGS "{{ _normalize_path(to_unix_path(cxx_flags)) }}") SET(CMAKE_C_FLAGS "{{ _normalize_path(to_unix_path(cc_flags)) }}") -% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)") +% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)") % cc_stds = STD_RE.findall(cc_flags) % cxx_stds = STD_RE.findall(cxx_flags) % if cc_stds: diff --git a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl index eefe1a5215..d8826fca80 100644 --- a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl +++ b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl @@ -1,5 +1,5 @@ % import re -% STD_RE = re.compile(r"(\-std=[a-z\+]+\d+)") +% STD_RE = re.compile(r"(\-std=[a-z\+]+\w+)") % cxx_stds = STD_RE.findall(cxx_flags) % cxx_std = cxx_stds[-1] if cxx_stds else "" % diff --git a/platformio/ide/tpls/emacs/.ccls.tpl b/platformio/ide/tpls/emacs/.ccls.tpl index 9aaf54658e..b6d7d55aa4 100644 --- a/platformio/ide/tpls/emacs/.ccls.tpl +++ b/platformio/ide/tpls/emacs/.ccls.tpl @@ -1,5 +1,5 @@ % import re -% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)") +% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)") % cc_stds = STD_RE.findall(cc_flags) % cxx_stds = STD_RE.findall(cxx_flags) % diff --git a/platformio/ide/tpls/vim/.ccls.tpl b/platformio/ide/tpls/vim/.ccls.tpl index 9aaf54658e..b6d7d55aa4 100644 --- a/platformio/ide/tpls/vim/.ccls.tpl +++ b/platformio/ide/tpls/vim/.ccls.tpl @@ -1,5 +1,5 @@ % import re -% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)") +% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)") % cc_stds = STD_RE.findall(cc_flags) % cxx_stds = STD_RE.findall(cxx_flags) % diff --git a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl index e6dda8957d..e99957cb4d 100644 --- a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl @@ -6,6 +6,14 @@ % % systype = platform.system().lower() % +% cpp_standards_remap = { +% "0x": "11", +% "1y": "14", +% "1z": "17", +% "2a": "20", +% "2b": "23" +% } +% % def _escape(text): % return to_unix_path(text).replace('"', '\\"') % end @@ -68,7 +76,7 @@ % % cleaned_includes = filter_includes(includes, ["toolchain"]) % -% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)") +% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)") % cc_stds = STD_RE.findall(cc_flags) % cxx_stds = STD_RE.findall(cxx_flags) % cc_m_flags = split_args(cc_flags) @@ -115,7 +123,7 @@ "cStandard": "c{{ cc_stds[-1] }}", % end % if cxx_stds: - "cppStandard": "c++{{ cxx_stds[-1] }}", + "cppStandard": "c++{{ cpp_standards_remap.get(cxx_stds[-1], cxx_stds[-1]) }}", % end % if forced_includes: "forcedInclude": [