From f3d530f73559c77750ebe5648ac6ecac7b5b87a7 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Fri, 14 Aug 2026 15:28:20 -0700 Subject: [PATCH 1/2] IECore, IECoreScene, IECoreAlembic : Add `fmt` 12.2.0 compatibility --- Changes | 7 +++++++ contrib/IECoreAlembic/src/IECoreAlembic/AlembicScene.cpp | 2 +- include/IECore/TypeIds.h | 6 ++++++ include/IECoreScene/PrimitiveVariable.h | 6 ++++++ src/IECore/StreamIndexedIO.cpp | 6 ++++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 69d171b63a..6fafc938e4 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,13 @@ Improvements ------------ - PathMatcher : Added `in()` and `containing()` methods. +- TypeId : Added `format_as` overload, so that TypeIds can be passed to `fmt::format()`. +- PrimitiveVariable : Added `format_as` overload for `Interpolation`, so that it can be passed to `fmt::format()`. + +Build +----- + +- LibFormat : Added compatibility with `fmt` 12.2.0. 10.7.0.0 ======== diff --git a/contrib/IECoreAlembic/src/IECoreAlembic/AlembicScene.cpp b/contrib/IECoreAlembic/src/IECoreAlembic/AlembicScene.cpp index 9da070f488..0f5428487a 100644 --- a/contrib/IECoreAlembic/src/IECoreAlembic/AlembicScene.cpp +++ b/contrib/IECoreAlembic/src/IECoreAlembic/AlembicScene.cpp @@ -836,7 +836,7 @@ class AlembicScene::AlembicReader : public AlembicIO IECore::msg( IECore::Msg::Warning, "AlembicScene::readAttributeAtSample", - "Unsupported attribute type datatype: \"{}\" extent:{} interpretation:\"{}\"", pod, extent, getInterpretation() + "Unsupported attribute type datatype: \"{}\" extent:{} interpretation:\"{}\"", fmt::underlying( pod ), extent, getInterpretation() ); return nullptr; diff --git a/include/IECore/TypeIds.h b/include/IECore/TypeIds.h index 9a02b4108c..23112ff267 100644 --- a/include/IECore/TypeIds.h +++ b/include/IECore/TypeIds.h @@ -326,6 +326,12 @@ enum TypeId }; +/// Enable fmtlib formatting of TypeId as its numeric value. +inline int format_as( TypeId typeId ) +{ + return static_cast( typeId ); +} + } // namespace IECore #endif // IE_CORE_TYPEIDS_H diff --git a/include/IECoreScene/PrimitiveVariable.h b/include/IECoreScene/PrimitiveVariable.h index a5a403c4c7..401f8964e3 100644 --- a/include/IECoreScene/PrimitiveVariable.h +++ b/include/IECoreScene/PrimitiveVariable.h @@ -108,6 +108,12 @@ struct IECORESCENE_API PrimitiveVariable }; +/// Enable fmtlib formatting of Interpolation as its numeric value. +inline int format_as( PrimitiveVariable::Interpolation interpolation ) +{ + return static_cast( interpolation ); +} + /// Utility class for iterating the `data` field from /// a PrimitiveVariable, using the `indices` field /// appropriately if it exists. diff --git a/src/IECore/StreamIndexedIO.cpp b/src/IECore/StreamIndexedIO.cpp index 0d9feb44e6..d6196d408c 100644 --- a/src/IECore/StreamIndexedIO.cpp +++ b/src/IECore/StreamIndexedIO.cpp @@ -579,6 +579,12 @@ protected : }; +/// Enable fmtlib formatting of NodeType as its numeric value. +inline int format_as( NodeBase::NodeType nodeType ) +{ + return static_cast( nodeType ); +} + /// Class that represents small data nodes class SmallDataNode : public NodeBase { From 6ae5b13ac2d479617d63739e5feee7ade29d4e95 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Fri, 14 Aug 2026 15:36:22 -0700 Subject: [PATCH 2/2] SConstruct : Remove FMT_DEPRECATED workaround With the addition of the `format_as` overloads in the previous commit, we no longer hit deprecated code in `fmt` and can remove this workaround. --- SConstruct | 4 ---- 1 file changed, 4 deletions(-) diff --git a/SConstruct b/SConstruct index 34dcdae00a..176906c449 100644 --- a/SConstruct +++ b/SConstruct @@ -873,10 +873,6 @@ if env["PLATFORM"] != "win32" : if clangVersion >= [ 15, 0, 0 ] : env.Append( CXXFLAGS = [ "-DBOOST_NO_CXX98_FUNCTION_BASE", "-D_HAS_AUTO_PTR_ETC=0" ] ) if clangVersion >= [ 16, 0, 0 ] : - # XCode 16 warns about deprecations in fmtlib. Overriding `FMT_DEPRECATED` - # allows us to remove the [[deprecated]] attributes and still build with - # `-Werror,-Wdeprecated-declarations`. - env.Append( CPPDEFINES = [ ( "FMT_DEPRECATED", "" ), ] ) # Disable new warnings about ObjectInterpolator::InterpolatorDescription's reinterpret_cast. env.Append( CXXFLAGS = [ "-Wno-cast-function-type-mismatch" ] ) # Disable FMA on arm64 builds to limit floating point discrepancies with x86_64 builds.