From f7ec0b0ac40045450bd86b73ca59b32a15bc8346 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 14 Feb 2019 11:40:24 +0300 Subject: VisualStudioIntegrationGenerator: put CXXFLAGS to AdditionalOptions Adding AdditionalOptions to nmake project settings allows IntelliSense to know about used compiler switches; specifically, passing std switch (currently -std:c++17) defines _MSVC_LANG macro [1] to proper value to avoid false IntelliSense errors (e.g., for string_view). [1] https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros Change-Id: I90309e6bf2a87257a0c81b1406e678af962eb587 Reviewed-on: https://gerrit.libreoffice.org/67805 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- bin/gbuild-to-ide | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin') diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide index 9ed964339c7f..1365c548c218 100755 --- a/bin/gbuild-to-ide +++ b/bin/gbuild-to-ide @@ -1031,6 +1031,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): if not os.path.exists(folder): os.makedirs(folder) project_guid = str(uuid.uuid4()).upper() + cxxflags = ' '.join(target.cxxflags) ns = 'http://schemas.microsoft.com/developer/msbuild/2003' ET.register_namespace('', ns) proj_node = ET.Element('{%s}Project' % ns, DefaultTargets='Build', ToolsVersion='4.0') @@ -1100,6 +1101,8 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): nmake_defs_node.text = ';'.join(self.defs_list(target.defs) + ['$(NMakePreprocessorDefinitions)']) include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % ns) include_path_node.text = include_path_node_text + additional_options_node = ET.SubElement(conf_node, '{%s}AdditionalOptions' % ns) + additional_options_node.text = cxxflags ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns) -- cgit