ICU-20076 MSVC Warning clean up. Define _HAS_EXCEPTIONS=0 in ICU library code (#128)

In an effort to reduce the number of warnings that building ICU emits, we should set the following define for ICU4C library code when building using MSVC/VisualStudio: _HAS_EXCEPTIONS=0
This tells the MSVC implementation of the STL that exceptions should not be used - which is fine for ICU4C library code, as the library code does not make use of exceptions at all.
This commit is contained in:
Jeff Genovy 2018-09-19 01:21:57 -07:00 committed by Shane Carr
parent 65b75640e2
commit c8e4c81d4e
No known key found for this signature in database
GPG Key ID: FCED3B24AAB18B5C
7 changed files with 33 additions and 2 deletions

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html -->
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This file is used to set configurations that are common to *all* ICU library code (common, i18n, and io). -->
<!-- Note: These options are for *all* configurations for *all* library projects. -->
<ItemDefinitionGroup>
<ClCompile>
<!-- ICU does not use exceptions in library code. -->
<PreprocessorDefinitions>
_HAS_EXCEPTIONS=0;
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<!-- Disable MSBuild warning about Linker OutputFile. -->
<!-- Ex: MSBuild complains that the common project creates "icuuc62.dll" rather than "common.dll". However, this is intentional. -->
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
</Project>

View File

@ -2,6 +2,8 @@
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- The following import will include the 'default' configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.ProjectConfiguration.props" />
<!-- The following import will include the library configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.Library.ProjectConfiguration.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}</ProjectGuid>
</PropertyGroup>

View File

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- The following import will include the UWP configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.UWP.ProjectConfiguration.props" />
<!-- The following import will include the library configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.Library.ProjectConfiguration.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>

View File

@ -2,6 +2,8 @@
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- The following import will include the 'default' configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.ProjectConfiguration.props" />
<!-- The following import will include the library configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.Library.ProjectConfiguration.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{0178B127-6269-407D-B112-93877BB62776}</ProjectGuid>
</PropertyGroup>

View File

@ -2,6 +2,8 @@
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- The following import will include the 'default' configuration options for VS UWP projects. -->
<Import Project="..\allinone\Build.Windows.UWP.ProjectConfiguration.props" />
<!-- The following import will include the library configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.Library.ProjectConfiguration.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>

View File

@ -2,7 +2,8 @@
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- The following import will include the 'default' configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.ProjectConfiguration.props" />
<!-- The following import will include the library configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.Library.ProjectConfiguration.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{C2B04507-2521-4801-BF0D-5FD79D6D518C}</ProjectGuid>
</PropertyGroup>

View File

@ -2,7 +2,8 @@
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- The following import will include the 'default' configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.ProjectConfiguration.props" />
<!-- The following import will include the library configuration options for VS projects. -->
<Import Project="..\allinone\Build.Windows.Library.ProjectConfiguration.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{203EC78A-0531-43F0-A636-285439BDE025}</ProjectGuid>
</PropertyGroup>