Skip to content

Commit

Permalink
Conform embedded to what's in pxr-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dgovil committed Oct 3, 2024
1 parent 27c9ca0 commit 84a3c21
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,9 @@ def _RunBuild(arch):
if MacOSTargetEmbedded(context):
env["SDKROOT"] = apple_utils.GetSDKRoot(context)
buildArgs.append(f' compiler=clang arch=arm64 extra_inc=big_iron.inc target={context.buildTarget.lower()}')
if context.buildAppleFramework and context.buildMonolithic:
# Force build of static libs as well
buildArgs.append(f" extra_inc=big_iron.inc ")
makeTBBCmd = 'make -j{procs} arch={arch} {buildArgs}'.format(
arch=arch, procs=context.numJobs,
buildArgs=" ".join(buildArgs))
Expand Down Expand Up @@ -1958,6 +1961,7 @@ def InstallUSD(context, force, buildArgs):
default=codesignDefault, action="store_true",
help=("Enable code signing for macOS builds "
"(defaults to enabled on Apple Silicon)"))
group.add_argument("--codesign-id", dest="macos_codesign_id", type=str)

if Linux():
group.add_argument("--use-cxx11-abi", type=int, choices=[0, 1],
Expand Down Expand Up @@ -2270,16 +2274,15 @@ def __init__(self, args):
self.forceBuild = [dep.lower() for dep in args.force_build]

# Some components are disabled for embedded build targets
embedded = MacOSTargetEmbedded(self)
optional_components = not (embedded or (MacOS() and self.buildAppleFramework))
embedded = (MacOS() and (MacOSTargetEmbedded(self) or self.buildAppleFramework))

# Optional components
self.buildTests = args.build_tests and optional_components
self.buildPython = args.build_python and optional_components
self.buildTests = args.build_tests and not embedded
self.buildPython = args.build_python and not embedded
self.buildBoostPython = self.buildPython and args.build_boost_python
self.buildExamples = args.build_examples and optional_components
self.buildTutorials = args.build_tutorials and optional_components
self.buildTools = args.build_tools and optional_components
self.buildExamples = args.build_examples and not embedded
self.buildTutorials = args.build_tutorials and not embedded
self.buildTools = args.build_tools and not embedded

# - Documentation
self.buildDocs = args.build_docs or args.build_python_docs
Expand All @@ -2292,7 +2295,7 @@ def __init__(self, args):
self.enablePtex = self.buildImaging and args.enable_ptex
self.enableOpenVDB = (self.buildImaging
and args.enable_openvdb
and optional_components)
and not embedded)

# - USD Imaging
self.buildUsdImaging = (args.build_imaging == USD_IMAGING)
Expand All @@ -2309,8 +2312,8 @@ def __init__(self, args):
if args.prman_location else None)
self.buildOIIO = ((args.build_oiio or (self.buildUsdImaging
and self.buildTests))
and optional_components)
self.buildOCIO = args.build_ocio and optional_components
and not embedded)
self.buildOCIO = args.build_ocio and not embedded

# - Alembic Plugin
self.buildAlembic = args.build_alembic
Expand Down Expand Up @@ -2615,6 +2618,7 @@ def _JoinVersion(v):
summaryMsg += """\
Variant {buildVariant}
Target {buildTarget}
Framework Build {buildAppleFramework}
Imaging {buildImaging}
Ptex support: {enablePtex}
OpenVDB support: {enableOpenVDB}
Expand Down Expand Up @@ -2699,7 +2703,8 @@ def FormatBuildArguments(buildArgs):
buildMaterialX=("On" if context.buildMaterialX else "Off"),
buildMayapyTests=("On" if context.buildMayapyTests else "Off"),
buildAnimXTests=("On" if context.buildAnimXTests else "Off"),
enableHDF5=("On" if context.enableHDF5 else "Off"))
enableHDF5=("On" if context.enableHDF5 else "Off"),
buildAppleFramework=("On" if MacOS() and context.buildAppleFramework else "Off"))

Print(summaryMsg)

Expand Down Expand Up @@ -2761,8 +2766,9 @@ def FormatBuildArguments(buildArgs):
])

if MacOS():
if context.macOSCodesign:
apple_utils.Codesign(context.usdInstDir, verbosity > 1)
# We don't need to codesign when building a framework because it's handled during framework creation
if context.macOSCodesign and not context.buildAppleFramework:
apple_utils.Codesign(context, verbosity > 1)

additionalInstructions = any([context.buildPython, context.buildTools, context.buildPrman])
if additionalInstructions:
Expand All @@ -2785,3 +2791,9 @@ def FormatBuildArguments(buildArgs):
if context.buildPrman:
Print("See documentation at http://openusd.org/docs/RenderMan-USD-Imaging-Plugin.html "
"for setting up the RenderMan plugin.\n")

if context.buildAppleFramework:
Print("""
Add the following framework to your Xcode Project:
OpenUSD.framework
""")

0 comments on commit 84a3c21

Please sign in to comment.