-
Notifications
You must be signed in to change notification settings - Fork 215
EMSUSD-2133 - [GitHub #4095] Remove Boost #4250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
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.
@@ -54,7 +54,7 @@ IncludeCategories: | |||
# Priority 0 | |||
|
|||
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New file which I'll describe its purpose below.
@@ -527,9 +527,9 @@ def BuildAndInstall(context, buildArgs, stages): | |||
# Many people on Windows may not have python with the | |||
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply renamed this flag to remove BOOST
namespace MayaUsdCxxLegacySupport { | ||
using boost::optional; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -67,7 +67,8 @@ bool UsdMayaShaderReader::TraverseUnconnectableInput(const TfToken& usdAttrName) | |||
|
|||
void UsdMayaShaderReader::PostConnectSubtree(UsdMayaPrimReaderContext* context) { } | |||
|
|||
boost::optional<UsdMayaShaderReader::IsConverterResult> UsdMayaShaderReader::IsConverter() | |||
MayaUsdCxxLegacySupport::optional<UsdMayaShaderReader::IsConverterResult> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from that new legacy header. C++14 == boost::optional, C++17 == std::optional
@@ -626,11 +626,7 @@ px_vp20Utils::GetLightingContextFromDrawContext(const MHWRender::MDrawContext& c | |||
light.SetSpotCutoff(lightCutoff); | |||
light.SetSpotFalloff(lightFalloff); | |||
light.SetAttenuation(lightAttenuation); | |||
#if HDX_API_VERSION >= 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
EMSUSD-2133 - [GitHub #4095] Remove Boost