Skip to content

Commit

Permalink
Fix the boost dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
samir-adsk committed Jan 10, 2025
1 parent 241d939 commit 5891485
Showing 1 changed file with 67 additions and 6 deletions.
73 changes: 67 additions & 6 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,8 +1356,9 @@ def InstallOpenVDB(context, force, buildArgs):

# Make sure to use boost installed by the build script and not any
# system installed boost
extraArgs.append('-DBoost_NO_BOOST_CMAKE=On')
extraArgs.append('-DBoost_NO_SYSTEM_PATHS=True')
extraArgs.append('-DBoost_NO_BOOST_CMAKE=OFF')
extraArgs.append('-DBoost_NO_SYSTEM_PATHS=ON')
extraArgs.append('-DBoost_USE_STATIC_LIBS=ON')

extraArgs.append('-DBLOSC_ROOT="{instDir}"'
.format(instDir=context.instDir))
Expand Down Expand Up @@ -1410,8 +1411,8 @@ def InstallOpenImageIO(context, force, buildArgs):

# Make sure to use boost installed by the build script and not any
# system installed boost
extraArgs.append('-DBoost_NO_BOOST_CMAKE=On')
extraArgs.append('-DBoost_NO_SYSTEM_PATHS=True')
extraArgs.append('-DBoost_NO_BOOST_CMAKE=OFF')
extraArgs.append('-DBoost_NO_SYSTEM_PATHS=ON')

# OpenImageIO 2.3.5 changed the default postfix for debug library
# names from "" to "_d". USD's build system currently does not support
Expand Down Expand Up @@ -1870,8 +1871,68 @@ def InstallUSD(context, force, buildArgs):

# Make sure to use boost installed by the build script and not any
# system installed boost
extraArgs.append('-DBoost_NO_BOOST_CMAKE=On')
extraArgs.append('-DBoost_NO_SYSTEM_PATHS=True')
extraArgs.append('-DBoost_NO_BOOST_CMAKE=OFF')
extraArgs.append('-DBoost_NO_SYSTEM_PATHS=ON')

# Only use static boost for non-python build,
# as linking boost::python statically has problem with the Python bindings
if not context.buildPython:
extraArgs.append('-DBoost_USE_STATIC_LIBS=True')

if context.targetAndroid:
extraArgs.append('-DUSD_ANDROID_PATH="{instDir}"'.format(instDir=context.instDir))

extraArgs += buildArgs

if context.targetWasm:

if context.buildJsBindings:
extraArgs.append('-DPXR_ENABLE_JS_BINDINGS_SUPPORT=ON')
else:
extraArgs.append('-DPXR_ENABLE_JS_BINDINGS_SUPPORT=OFF')

extraArgs.append('-DPXR_ENABLE_JS_SUPPORT=ON')
# For some reason we have to manually specify path to boost
extraArgs.append('-DBoost_INCLUDE_DIR="{}"'.format(os.path.join(context.usdInstDir, "include")))

extraArgs.append('-DTBB_INCLUDE_DIRS="{}"'.format(os.path.join(context.usdInstDir, 'include')))
extraArgs.append('-DTBB_tbb_LIBRARY_DEBUG="{}"'.format(os.path.join(context.usdInstDir, 'lib/libtbb_debug.a')))
extraArgs.append('-DTBB_tbb_LIBRARY_RELEASE="{}"'.format(os.path.join(context.usdInstDir, 'lib/libtbb.a')))

extraArgs.append('-DOPENSUBDIV_INCLUDE_DIR="{}"'.format(os.path.join(context.usdInstDir, 'include')))
extraArgs.append('-DOPENSUBDIV_OSDCPU_LIBRARY="{}"'.format(os.path.join(context.usdInstDir, 'lib/libosdCPU.a')))

extraArgs.append('-DPXR_ENABLE_GL_SUPPORT=ON')
extraArgs.append('-DBUILD_SHARED_LIBS=OFF')
extraArgs.append('-DPXR_BUILD_PERFORMANCE=OFF')

if context.targetWasmNode:
extraArgs.append('-DPXR_WASM_NODE=ON')
else:
extraArgs.append('-DPXR_WASM_NODE=OFF')

else:
# JS binding is only possibly enabled for webassembly build
extraArgs.append('-DPXR_ENABLE_JS_BINDINGS_SUPPORT=OFF')

if context.buildWebGPU:
extraArgs.append('-DPXR_ENABLE_WEBGPU_SUPPORT=ON')

# Clean before next generation happens
testPath = ""
if context.targetIOS and context.buildTests:
testPath = context.buildDir + "/iOSTests"
if os.path.exists(testPath):
shutil.rmtree(testPath)
extraArgs.append('-DIOS_UT_TARGET={}'.format(testPath))

if context.targetAndroid and context.buildTests:
testPath = os.path.join(context.buildDir, "AndroidTests")
if os.path.exists(testPath):
shutil.rmtree(testPath)
extraArgs.append('-DANDROID_UT_TEMP_DIR={}'.format(testPath.replace(os.sep, '/')))

extraArgs += HIDDEN_SYMBOLS
extraArgs += buildArgs

RunCMake(context, force, extraArgs)
Expand Down

0 comments on commit 5891485

Please sign in to comment.