Skip to content

Commit

Permalink
check for -G prefix, error out when -G is used together with --use-ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Oct 22, 2014
1 parent 94cfbaf commit bd67b65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/catkin_make
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ def main():
print(fmt('@{yf}Packages @{boldon}"%s"@{boldoff} not found in the workspace - ignoring them' % ', '.join(sorted(unknown_packages))), file=sys.stderr)
args.pkg = [name for name in args.pkg if name in packages_by_name]

if '-G' not in cmake_args:
if not [arg for arg in cmake_args if arg.startswith('-G')]:
if not args.use_ninja:
cmake_args += ['-G', 'Unix Makefiles']
else:
cmake_args += ['-G', 'Ninja']
elif args.use_ninja:
return fmt("@{rf}Error: either specify a generator using '-G...' or '--use-ninja' but not both")

# check if cmake must be run (either for a changed list of package paths or changed cmake arguments)
force_cmake = cmake_input_changed(packages, build_path, cmake_args=cmake_args)
Expand Down
6 changes: 5 additions & 1 deletion python/catkin/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,11 +803,15 @@ def build_workspace_isolated(
else:
cmake_args = []

if '-G' not in cmake_args:
if not [arg for arg in cmake_args if arg.startswith('-G')]:
if not use_ninja:
cmake_args += ['-G', 'Unix Makefiles']
else:
cmake_args += ['-G', 'Ninja']
elif use_ninja:
print(colorize_line("Error: either specify a generator using '-G...' or '--use-ninja' but not both"))
sys.exit(1)


if make_args:
print("Additional make Arguments: " + " ".join(make_args))
Expand Down

0 comments on commit bd67b65

Please sign in to comment.