EMSUSD-2133 - [GitHub #4095] Remove Boost#4250
Conversation
* New cxx17_legacy_support.h file to deal with c++14/17. * No longer need to find Boost. Removed linking of Boost. * Conditional boost compile definitions. * Rewrote coding guidelines related to Boost. * Fixed comments to remove Boost. * boost::has -> TfHash/std::hash.
|
|
||
| # 3. All public headers from this repository (maya-usd) | ||
| - Regex: '^<(mayaUsd.*|hdMaya|AL|usdMaya)/' | ||
| - Regex: '(cxx17_legacy_support\.h|^<(mayaUsd.*|hdMaya|AL|usdMaya)/)' |
There was a problem hiding this comment.
New file which I'll describe its purpose below.
| # debugging symbol (python27_d.lib) installed, this is the common case. | ||
| if context.buildDebug and context.debugPython: | ||
| extraArgs.append('-DMAYAUSD_DEFINE_BOOST_DEBUG_PYTHON_FLAG=ON') | ||
| extraArgs.append('-DMAYAUSD_DEFINE_DEBUG_PYTHON_FLAG=ON') |
There was a problem hiding this comment.
Simply renamed this flag to remove BOOST
| namespace MayaUsdCxxLegacySupport { | ||
| using boost::optional; | ||
| } |
There was a problem hiding this comment.
Unfortunately when compiling with C++14 there is no std::optional - thus there are a couple of cases where its still needed. Its our older builds for Maya 2023. That build has a USD which still has boost.
| void UsdMayaShaderReader::PostConnectSubtree(UsdMayaPrimReaderContext* context) { } | ||
|
|
||
| boost::optional<UsdMayaShaderReader::IsConverterResult> UsdMayaShaderReader::IsConverter() | ||
| MayaUsdCxxLegacySupport::optional<UsdMayaShaderReader::IsConverterResult> |
There was a problem hiding this comment.
This comes from that new legacy header. C++14 == boost::optional, C++17 == std::optional
| light.SetSpotCutoff(lightCutoff); | ||
| light.SetSpotFalloff(lightFalloff); | ||
| light.SetAttenuation(lightAttenuation); | ||
| #if HDX_API_VERSION >= 6 |
There was a problem hiding this comment.
USD v21.11 is our min, so only need to support 9+
| // To get rid of boost here, switch to C++17 compatible implementation: | ||
| // return std::hash(std::string_view(s.asChar(), s.length()))(); | ||
| #if (__cplusplus >= 201703L) | ||
| return std::hash<std::string_view> {}(std::string_view(s.asChar(), s.length())); |
There was a problem hiding this comment.
std::string_view is C++17, so again we still need to support older Maya 2023 builds using boost.
|
@hamedsabri Hamed, can you have a look at these changes to remove Boost and let me know if everything looks good. @dj-mcg Dan, can you try building with this branch to make sure these changes don't affect your internal build system. |
|
@AramAzhari-adsk I had to merge in latest dev to resolve some conflicts. Nothing should have changed. |
EMSUSD-2133 - [GitHub #4095] Remove Boost