# file      : libicui18n/buildfile
# license   : Unicode License; see accompanying LICENSE file

import intf_libs = libicuuc%lib{icuuc}

lib{icui18n}: {hxx}{**} i18n/cxx{*} $intf_libs

# Build options.
#
cxx.poptions  += -DU_I18N_IMPLEMENTATION

cxx.poptions =+ "-I$src_base/i18n"

obja{*}: cxx.poptions += -DU_STATIC_IMPLEMENTATION

cxx.coptions += $common_cc_coptions     \
                $common_cxx_coptions    \
                $lib_cc_coptions

switch $cxx.class
{
  case 'gcc'
  {
    # Disable the Clang targeting MSVC warnings.
    #
    if ($cxx.id == 'clang' && $tsys == 'win32-msvc')
      cxx.coptions += -Wno-ignored-pragma-optimize
  }
  case 'msvc'
  {
    # Disable warnings that pop up with /W3.
    #
    cxx.coptions += /wd4244 /wd4996 /wd5055 /wd5056
  }
}

cxx.loptions += $lib_cc_loptions
cxx.libs += $common_cxx_libs

# Export options.
#
lib{icui18n}:
{
  cc.export.poptions = "-I$src_base/i18n"
  cc.export.libs     = $intf_libs
}

liba{icui18n}: cc.export.poptions += -DU_STATIC_IMPLEMENTATION

# See bootstrap.build for details.
#
# Note that on Windows and POSIX the library is named quite differently as
# icuin65.dll and libicui18n.so.65.1, respectivelly. We name it consistently
# as libicui18n-65.dll and libicui18n-65.so.
#
if $version.pre_release
  lib{icui18n}: bin.lib.version = @"-$version.project_id"
else
  lib{icui18n}: bin.lib.version = @"-$abi_version_major" linux@"$abi_version"

# Install headers from the i18n/unicode/ subdirectory only.
#
hxx{*}:              install = false
i18n/unicode/hxx{*}: install = include/unicode/
