forked from mirrors/0ad
Update (and debundle) fmt dependancy
We now support the most recent released version of `fmt` available (at
the time
of committing).
As we no longer patch `fmt` to get it to work within `pyrogenesis`, this
commit
also mostly removes its source from our code-tree (some headers are
retained for
Windows builds).
If you are a user of...
Linux/BSD: You will now need to have `fmt` installed from your
distribution's
package repository. The minimum supported version of `fmt` is
`4.0`.
OSX: The source is acquired and compiled (in `build-osx-libs.sh`),
then included and linked automatically.
Windows: The relevant header files are retained and, along with a
pre-built
library, are the only things still bundled.
Accepted by: wraitii
Tested by:
* Freagarach (Lubuntu 18.04, `fmt 4.0.0`)
* Krinkle (MacOS 10.14, `fmt 6.1.2`)
* nephele (Alpine Linux)
* wraitii (MacOS 10.14)
* Nescio (Fedora 33, `fmt 7.0.3`)
Windows library files built by: Stan
Fixes: #3190
Differential Revision: https://code.wildfiregames.com/D2689
This was SVN commit r24267.
This commit is contained in:
@@ -32,6 +32,9 @@ win32/ contains headers and precompiled static libs for Windows builds.
|
||||
win32/enet
|
||||
MIT
|
||||
|
||||
win32/fmt
|
||||
MIT
|
||||
|
||||
win32/gloox
|
||||
GPL v3
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ ICU_VERSION="icu4c-67_1"
|
||||
ENET_VERSION="enet-1.3.17"
|
||||
MINIUPNPC_VERSION="miniupnpc-2.1"
|
||||
SODIUM_VERSION="libsodium-1.0.18"
|
||||
FMT_VERSION="7.1.3"
|
||||
# --------------------------------------------------------------
|
||||
# Bundled with the game:
|
||||
# * SpiderMonkey
|
||||
@@ -892,6 +893,49 @@ else
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
# --------------------------------------------------------------
|
||||
echo -e "Building fmt..."
|
||||
|
||||
LIB_DIRECTORY="fmt-$FMT_VERSION"
|
||||
LIB_ARCHIVE="$FMT_VERSION.tar.gz"
|
||||
LIB_URL="https://github.com/fmtlib/fmt/archive/"
|
||||
|
||||
mkdir -p fmt
|
||||
pushd fmt > /dev/null
|
||||
|
||||
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$FMT_VERSION" ]]
|
||||
then
|
||||
rm -f .already-built
|
||||
|
||||
download_lib $LIB_URL $LIB_ARCHIVE
|
||||
|
||||
rm -rf $LIB_DIRECTORY include lib
|
||||
tar -xf $LIB_ARCHIVE
|
||||
pushd $LIB_DIRECTORY
|
||||
|
||||
# It appears that older versions of Clang require constexpr statements to have a user-set constructor.
|
||||
patch -Np1 -i ../../patches/fmt_constexpr.diff
|
||||
|
||||
mkdir -p build
|
||||
pushd build
|
||||
|
||||
(cmake .. \
|
||||
-DFMT_TEST=False \
|
||||
-DFMT_DOC=False \
|
||||
&& make fmt ${JOBS}) || die "fmt build failed"
|
||||
popd
|
||||
|
||||
mkdir -p ../lib
|
||||
cp build/libfmt.a ../lib/
|
||||
cp -r include ../include
|
||||
|
||||
popd
|
||||
echo "$FMT_VERSION" > .already-built
|
||||
else
|
||||
already_built
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# The following libraries are shared on different OSes and may
|
||||
# be customized, so we build and install them from bundled sources
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
diff --git a/include/fmt/os.h b/include/fmt/os.h
|
||||
index 88151006..11c3b2cc 100644
|
||||
--- a/include/fmt/os.h
|
||||
+++ b/include/fmt/os.h
|
||||
@@ -375,7 +375,7 @@ struct ostream_params {
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
-static constexpr detail::buffer_size buffer_size;
|
||||
+static constexpr detail::buffer_size buffer_size{};
|
||||
|
||||
// A fast output stream which is not thread-safe.
|
||||
class ostream final : private detail::buffer<char> {
|
||||
Reference in New Issue
Block a user