Lines Matching +full:cmake +full:- +full:args
11 # http://www.apache.org/licenses/LICENSE-2.0
23 Get and build dependent repositories using known-good commits.
26 -------
31 repository at a "known-good" commit in order to provide stability in
35 --------------------
39 Known-Good JSON Database
40 ------------------------
42 This program expects to find a file named "known-good.json" in the
47 ---------------
49 See the help text (update_deps.py --help) for a complete list of options.
52 -----------------
56 repositories. The user can override this by using the "--dir" option.
64 $ cd My-Repo
69 or, to do the same thing, but using the --dir option:
71 $ cd My-Repo
73 $ scripts/update_deps.py --dir=build
82 $ cd My-Repo
83 $ scripts/update_deps.py --dir=/tmp/deps
88 Helper CMake Config File
89 ------------------------
92 named "helper.cmake" to the "top" directory that contains CMake commands
93 for setting CMake variables for locating the dependent repositories.
94 This helper file can be used to set up the CMake build files for this
99 $ git clone git@github.com:My-Group/My-Repo.git
100 $ cd My-Repo
104 $ cmake -C helper.cmake ..
105 $ cmake --build .
108 ----------------
110 There's no formal schema for the "known-good" JSON file, but here is
115 - name
120 - url
123 Example: https://github.com/KhronosGroup/Vulkan-Loader.git
125 - sub_dir
130 - build_dir
135 - install_dir
140 - commit
142 The commit used to checkout the repository. This can be a SHA-1
144 For example, this field can be set to "origin/sdk-1.1.77" to
145 select the end of the sdk-1.1.77 branch.
147 - deps (optional)
149 An array of pairs consisting of a CMake variable name and a
156 "repo_name" : "Vulkan-Headers"
160 which represents that this repository depends on the Vulkan-Headers
161 repository and uses the VULKAN_HEADERS_INSTALL_DIR CMake variable to
162 specify the location where it expects to find the Vulkan-Headers install
167 - prebuild (optional)
168 - prebuild_linux (optional) (For Linux and MacOS)
169 - prebuild_windows (optional)
179 - custom_build (optional)
182 the built in CMake way of building. Requires "build_step" to be
195 {2} returns the CONFIG_MAP value of config e.g. debug -> Debug
197 {0}[Vulkan-Headers][repo_root] returns the repo_root variable from
198 the Vulkan-Headers GoodRepo object.
200 - cmake_options (optional)
202 A list of options to pass to CMake during the generation phase.
204 - ci_only (optional)
207 (case-insensitive) in order for this repo to be fetched and built.
215 - build_step (optional)
221 - build_platforms (optional)
232 ----
236 supported. However, the "top" directory specified with the "--dir"
289 """Represents a repository at a known-good commit."""
291 def __init__(self, json, args): argument
294 Args:
296 'args': Results from ArgumentParser
299 self._args = args
325 dir_top = os.path.abspath(args.dir)
377 """Build CMake command for the configuration phase and execute it"""
388 'cmake', self.repo_dir,
389 '-DCMAKE_INSTALL_PREFIX=' + self.install_dir
392 # For each repo this repo depends on, generate a CMake variable
398 cmake_cmd.append('-D{var_name}={install_dir}'.format(
402 # Add any CMake options
406 # Set build config for single-configuration generators
408 cmake_cmd.append('-DCMAKE_BUILD_TYPE={config}'.format(
411 # Use the CMake -A option to select the platform architecture
415 cmake_cmd.append('-A')
422 cmake_cmd.extend(['-G', self._args.generator])
425 print("CMake command: " + " ".join(cmake_cmd))
432 """Build CMake command for the build phase and execute it"""
433 cmake_cmd = ['cmake', '--build', self.build_dir, '--target', 'install']
435 cmake_cmd.append('--clean-first')
438 cmake_cmd.append('--config')
443 cmake_cmd.append('--')
450 print('warning: environment variable MAKE_JOBS has non-numeric value "{}". '
452 cmake_cmd.append('-j{}'.format(num_make_jobs))
454 cmake_cmd.append('--')
458 print("CMake command: " + " ".join(cmake_cmd))
477 # Build and execute CMake command for creating build files
480 # Build and execute CMake command for the build
484 def GetGoodRepos(args): argument
487 The known-good file is expected to be in the same
491 if args.known_good_dir:
492 known_good_file = os.path.join( os.path.abspath(args.known_good_dir),
499 GoodRepo(repo, args)
504 def GetInstallNames(args): argument
507 The known-good file is expected to be in the same
511 if args.known_good_dir:
512 known_good_file = os.path.join(os.path.abspath(args.known_good_dir),
525 def CreateHelper(args, repos, filename): argument
526 """Create a CMake config helper file.
528 The helper file is intended to be used with 'cmake -C <file>'
531 The install_names dictionary represents the CMake variables used by the
533 This information is baked into the CMake files of the home repo and so
538 install_names = GetInstallNames(args)
550 description='Get and build dependent repos at known-good commits')
552 '--known_good_dir',
556 '--dir',
561 '--ref',
566 '--no-build',
573 '--clean',
579 '--clean-repo',
585 '--clean-build',
591 '--clean-install',
597 '--arch',
604 '--config',
611 '--generator',
613 help="Set the CMake generator",
616 args = parser.parse_args()
620 distutils.dir_util.mkpath(args.dir)
621 abs_top_dir = os.path.abspath(args.dir)
623 repos = GetGoodRepos(args)
668 if args.do_build and repo.build_step != 'skip':
673 CreateHelper(args, repos, os.path.join(abs_top_dir, 'helper.cmake'))