Skip to content

Commit

Permalink
Adds a new command line option --cmake-build-args which will propog…
Browse files Browse the repository at this point in the history
…ate to all CMake invocations during the build process.

Fixes #2484

(Internal change: 2282413)
  • Loading branch information
matthewcpp authored and pixar-oss committed Jun 23, 2023
1 parent d3a3356 commit 28927ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ def RunCMake(context, force, extraArgs = None):
source code is located in the current working directory."""
# Create a directory for out-of-source builds in the build directory
# using the name of the current working directory.
if extraArgs is None:
extraArgs = []
else:
# ensure we can freely modify our extraArgs without affecting caller
extraArgs = list(extraArgs)

if context.cmakeBuildArgs:
extraArgs.insert(0, context.cmakeBuildArgs)
srcDir = os.getcwd()
instDir = (context.usdInstDir if srcDir == context.usdSrcDir
else context.instDir)
Expand Down Expand Up @@ -1908,6 +1916,10 @@ def InstallUSD(context, force, buildArgs):
group.add_argument("--build-args", type=str, nargs="*", default=[],
help=("Custom arguments to pass to build system when "
"building libraries (see docs above)"))
group.add_argument("--cmake-build-args", type=str,
help=("Custom arguments to pass to all builds that use "
"cmake; a single string, similar to the args passed "
"for a single dependency in --build-args"))
group.add_argument("--build-python-info", type=str, nargs=4, default=[],
metavar=('PYTHON_EXECUTABLE', 'PYTHON_INCLUDE_DIR', 'PYTHON_LIBRARY', 'PYTHON_VERSION'),
help=("Specify a custom python to use during build"))
Expand Down Expand Up @@ -2143,6 +2155,7 @@ def __init__(self, args):
# CMake generator and toolset
self.cmakeGenerator = args.generator
self.cmakeToolset = args.toolset
self.cmakeBuildArgs = args.cmake_build_args

# Number of jobs
self.numJobs = args.jobs
Expand Down

0 comments on commit 28927ea

Please sign in to comment.