From 33cf21828d257d95f28b10b15ca20041e5c0f00d Mon Sep 17 00:00:00 2001 From: Yves Boudreault Date: Mon, 11 Apr 2022 15:14:26 -0400 Subject: [PATCH] MAYA-122250 UFE 3 build as Universal Binary 2 (x86_64 + arm64) + Change a few compiler flags to be at part with Maya + Fix some easy Python 3 issues. --- CMakeLists.txt | 9 ++++++++- cmake/compiler_config.cmake | 3 ++- .../al/plugin/AL_USDMayaTestPlugin/py/testTranslators.py | 2 +- .../endToEndMaya/tutorial_scripts/add_set_to_s00.py | 6 +++--- .../tutorial_scripts/prep_anim_shot_s00_01.py | 6 +++--- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c20e986d4f..e962712325 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,9 @@ option(BUILD_TESTS "Build tests." ON) option(BUILD_STRICT_MODE "Enforce all warnings as errors." ON) option(BUILD_SHARED_LIBS "Build libraries as shared or static." ON) option(BUILD_WITH_PYTHON_3 "Build with python 3." OFF) +if(APPLE) + option(BUILD_UB2 "Build Universal Binary 2 (UB2) Intel64+arm64" OFF) +endif() set(BUILD_WITH_PYTHON_3_VERSION 3.7 CACHE STRING "The version of Python 3 to build with") option(CMAKE_WANT_UFE_BUILD "Enable building with UFE (if found)." ON) option(CMAKE_WANT_MATERIALX_BUILD "Enable building with MaterialX (experimental)." OFF) @@ -53,7 +56,11 @@ set(PXR_OVERRIDE_PLUGINPATH_NAME PXR_PLUGINPATH_NAME # Avoid noisy install messages set(CMAKE_INSTALL_MESSAGE "NEVER") -set(CMAKE_OSX_ARCHITECTURES "x86_64") +if (BUILD_UB2) + set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") +else() + set(CMAKE_OSX_ARCHITECTURES "x86_64") +endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} diff --git a/cmake/compiler_config.cmake b/cmake/compiler_config.cmake index a40a0fcf5f..6389379309 100644 --- a/cmake/compiler_config.cmake +++ b/cmake/compiler_config.cmake @@ -5,8 +5,9 @@ set(GNU_CLANG_FLAGS # we want to be as strict as possible -Wall $<$:-Werror> + $<$:-fstack-check> # optimization - -msse3 + -msse4.2 # disable warnings -Wno-deprecated -Wno-deprecated-declarations diff --git a/plugin/al/plugin/AL_USDMayaTestPlugin/py/testTranslators.py b/plugin/al/plugin/AL_USDMayaTestPlugin/py/testTranslators.py index 0a8caaf05a..a4a719495f 100755 --- a/plugin/al/plugin/AL_USDMayaTestPlugin/py/testTranslators.py +++ b/plugin/al/plugin/AL_USDMayaTestPlugin/py/testTranslators.py @@ -157,7 +157,7 @@ def postImport(self, prim): if self.__class__.parentNode: cmds.delete(self.__class__.parentNode) # re-create the node - # print 'CCCCCCCCCCCCc', cmds.createNode('AL_usdmaya_Transform', name='rig', parent='|bobo|root|peter01') + # print('CCCCCCCCCCCCc', cmds.createNode('AL_usdmaya_Transform', name='rig', parent='|bobo|root|peter01')) return True diff --git a/plugin/al/tutorials/endToEndMaya/tutorial_scripts/add_set_to_s00.py b/plugin/al/tutorials/endToEndMaya/tutorial_scripts/add_set_to_s00.py index feb7f9a441..72bb225fe4 100644 --- a/plugin/al/tutorials/endToEndMaya/tutorial_scripts/add_set_to_s00.py +++ b/plugin/al/tutorials/endToEndMaya/tutorial_scripts/add_set_to_s00.py @@ -45,9 +45,9 @@ def main(): stage.GetEditTarget().GetLayer().Save() - print '===' - print 'usdview %s' % sequenceFilePath - print 'usdcat %s' % setsLayoutLayerFilePath + print('===') + print('usdview %s' % sequenceFilePath) + print('usdcat %s' % setsLayoutLayerFilePath) if __name__ == '__main__': main() diff --git a/plugin/al/tutorials/endToEndMaya/tutorial_scripts/prep_anim_shot_s00_01.py b/plugin/al/tutorials/endToEndMaya/tutorial_scripts/prep_anim_shot_s00_01.py index 115003e1e6..40b162bdda 100644 --- a/plugin/al/tutorials/endToEndMaya/tutorial_scripts/prep_anim_shot_s00_01.py +++ b/plugin/al/tutorials/endToEndMaya/tutorial_scripts/prep_anim_shot_s00_01.py @@ -41,9 +41,9 @@ def main(): stage.GetEditTarget().GetLayer().Save() - print '===' - print 'usdview %s' % shotFilePath - print 'usdcat %s' % animLayerFilePath + print('===') + print('usdview %s' % shotFilePath) + print('usdcat %s' % animLayerFilePath) def _AddCueRigAndCacheVariants(stage): from pxr import Kind, Sdf, Usd, UsdGeom