Disable a bunch of ICU stuff we don't use

Bumps ~800KB off the executable (and 100MB off icu.lib).
This commit is contained in:
Thomas Goyne 2014-06-02 06:52:15 -07:00
parent 917913b0ef
commit 9f8a648017
4 changed files with 115 additions and 53 deletions

View file

@ -44,12 +44,44 @@
/>
</Target>
<!-- Project References -->
<ItemGroup>
<ProjectReference Include="..\icu\icu.vcxproj">
<Project>{f934ab7b-186b-4e96-b20c-a58c38c1b818}</Project>
</ProjectReference>
<ProjectReference Include="..\libiconv\libiconv.vcxproj">
<Project>{965054d2-44f2-4eb2-9879-051cc3d7ef08}</Project>
</ProjectReference>
</ItemGroup>
<!-- Source files -->
<ItemGroup>
<ClCompile Include="$(BoostPath)\libs\filesystem\src\codecvt_error_category.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\operations.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\path.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\path_traits.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\portability.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\unique_path.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\utf8_codecvt_facet.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\windows_file_codecvt.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\encoding\codepage.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\boundary.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\codecvt.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\collator.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\conversion.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\icu_backend.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\generator.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\ids.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\localization_backend.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\codecvt_converter.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\default_locale.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\info.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\locale_data.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\c_regex_traits.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\cpp_regex_traits.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\cregex.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\c_regex_traits.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\fileiter.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\icu.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\instances.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\posix_api.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\regex.cpp" />
@ -61,55 +93,20 @@
<ClCompile Include="$(BoostPath)\libs\regex\src\wc_regex_traits.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\wide_posix_api.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\winstances.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\codecvt_error_category.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\operations.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\path.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\path_traits.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\portability.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\unique_path.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\utf8_codecvt_facet.cpp" />
<ClCompile Include="$(BoostPath)\libs\filesystem\src\windows_file_codecvt.cpp" />
<ClCompile Include="$(BoostPath)\libs\system\src\error_code.cpp" />
<ClCompile Include="$(BoostPath)\libs\regex\src\icu.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\encoding\codepage.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\boundary.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\codecvt.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\collator.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\conversion.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\date_time.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\formatter.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\icu_backend.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\numeric.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\time_zone.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\date_time.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\format.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\formatting.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\generator.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\ids.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\localization_backend.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\message.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\shared\mo_lambda.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\codecvt_converter.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\default_locale.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\gregorian.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\info.cpp" />
<ClCompile Include="$(BoostPath)\libs\locale\src\util\locale_data.cpp" />
<ClCompile Include="$(BoostPath)\libs\thread\src\win32\thread.cpp" />
<ClCompile Include="$(BoostPath)\libs\thread\src\win32\tss_pe.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)locale_stubs.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(BoostPath)\libs\regex\src\internals.hpp" />
<ClInclude Include="$(BoostPath)\libs\filesystem\src\windows_file_codecvt.hpp" />
<ClInclude Include="$(BoostPath)\libs\system\src\local_free_on_destruction.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\encoding\conv.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\all_generator.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\cdata.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\codecvt.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\formatter.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\icu_backend.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\icu_util.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\predefined_formatters.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\time_zone.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\uconv.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\shared\ios_prop.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\shared\mo_hash.hpp" />
@ -119,6 +116,8 @@
<ClInclude Include="$(BoostPath)\libs\locale\src\util\locale_data.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\util\numeric.hpp" />
<ClInclude Include="$(BoostPath)\libs\locale\src\util\timezone.hpp" />
<ClInclude Include="$(BoostPath)\libs\regex\src\internals.hpp" />
<ClInclude Include="$(BoostPath)\libs\system\src\local_free_on_destruction.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="$(BoostPath)\libs\locale\src\encoding\iconv_codepage.ipp" />

View file

@ -117,21 +117,12 @@
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\conversion.cpp">
<Filter>locale\icu</Filter>
</ClCompile>
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\date_time.cpp">
<Filter>locale\icu</Filter>
</ClCompile>
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\formatter.cpp">
<Filter>locale\icu</Filter>
</ClCompile>
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\icu_backend.cpp">
<Filter>locale\icu</Filter>
</ClCompile>
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\numeric.cpp">
<Filter>locale\icu</Filter>
</ClCompile>
<ClCompile Include="$(BoostPath)\libs\locale\src\icu\time_zone.cpp">
<Filter>locale\icu</Filter>
</ClCompile>
<ClCompile Include="$(BoostPath)\libs\locale\src\util\codecvt_converter.cpp">
<Filter>locale\util</Filter>
</ClCompile>
@ -200,9 +191,6 @@
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\codecvt.hpp">
<Filter>locale\icu</Filter>
</ClInclude>
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\formatter.hpp">
<Filter>locale\icu</Filter>
</ClInclude>
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\icu_backend.hpp">
<Filter>locale\icu</Filter>
</ClInclude>
@ -212,9 +200,6 @@
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\predefined_formatters.hpp">
<Filter>locale\icu</Filter>
</ClInclude>
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\time_zone.hpp">
<Filter>locale\icu</Filter>
</ClInclude>
<ClInclude Include="$(BoostPath)\libs\locale\src\icu\uconv.hpp">
<Filter>locale\icu</Filter>
</ClInclude>
@ -257,4 +242,4 @@
<Filter>locale\encoding</Filter>
</None>
</ItemGroup>
</Project>
</Project>

View file

@ -0,0 +1,69 @@
// Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// Aegisub Project http://www.aegisub.org/
#include <boost/locale/gnu_gettext.hpp>
#include <boost/locale/localization_backend.hpp>
#include <unicode/locid.h>
// Boost.locale doesn't support partial builds of ICU, so provide stub versions
// of some of the things we don't use
namespace boost { namespace locale {
namespace impl_icu {
struct cdata {
icu::Locale locale;
std::string encoding;
bool utf8;
};
std::locale create_formatting(std::locale const& in, cdata const& cd, character_facet_type type) {
return in;
}
std::locale create_parsing(std::locale const& in, cdata const& cd, character_facet_type type) {
return in;
}
std::locale create_calendar(std::locale const& in, cdata const& cd) {
return in;
}
}
namespace gnu_gettext {
template<>
message_format<char> *create_messages_facet(messages_info const &info) {
return nullptr;
}
template<>
message_format<wchar_t> *create_messages_facet(messages_info const &info) {
return nullptr;
}
#ifdef BOOST_HAS_CHAR16_T
template<>
message_format<char16_t> *create_messages_facet(messages_info const &info) {
return nullptr;
}
#endif
#ifdef BOOST_HAS_CHAR32_T
template<>
message_format<char32_t> *create_messages_facet(messages_info const &info) {
return nullptr;
}
#endif
}
} }

View file

@ -23,6 +23,15 @@
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>
U_ENABLE_DYLOAD=0;
U_CHECK_DYLOAD=0;
UCONFIG_NO_FILE_IO=1;
UCONFIG_NO_LEGACY_CONVERSION=1;
U_CHARSET_IS_UTF8=1;
UCONFIG_NO_IDNA=1;
UCONFIG_NO_FORMATTING=1;
UCONFIG_NO_TRANSLITERATION=1;
U_ATTRIBUTE_DEPRECATED=;
_CRT_SECURE_NO_DEPRECATE;
U_COMMON_IMPLEMENTATION;