# -*- mode: python -*-
Import("env")
Import("has_option")
Import("debugBuild")
env = env.Clone()

# In libfmt 7.1.3, when compiling format.cc, this is needed for function fmt::internal::report_error()
# which uses `(void)fwrite(...)` to ignore an error. Gcc still flags it.
# (Follows https://github.com/fmtlib/fmt/issues/2185).
if env.ToolchainIs('GCC'):
    env.AppendUnique(CXXFLAGS=['-Wno-error=unused-result'])

env.Library(
    target='fmt',
    source=env.File([
        'format.cc',
        'os.cc',
    ], 'dist/src'),
)
