Permalink
Browse files

Ninja --generator-output to match other generators.

  • Loading branch information...
1 parent 9ab98f9 commit 2ea5a877b867e93e1dcc42fabe39bba63ad17025 bungeman@chromium.org committed Oct 2, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 pylib/gyp/generator/ninja.py
@@ -1298,10 +1298,18 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
flavor = gyp.common.GetFlavor(params)
generator_flags = params.get('generator_flags', {})
+ # generator_dir: relative path from pwd to where make puts build files.
+ # Makes migrating from make to ninja easier, ninja doesn't put anything here.
+ generator_dir = os.path.relpath(params['options'].generator_output or '.')
+
+ # output_dir: relative path from generator_dir to the build directory.
+ output_dir = generator_flags.get('output_dir', 'out')
+
# build_dir: relative path from source root to our output files.
# e.g. "out/Debug"
- build_dir = os.path.join(generator_flags.get('output_dir', 'out'),
- config_name)
+ build_dir = os.path.normpath(os.path.join(generator_dir,
+ output_dir,
+ config_name))
toplevel_build = os.path.join(options.toplevel_dir, build_dir)
@@ -1729,9 +1737,6 @@ def PerformBuild(data, configurations, params):
def GenerateOutput(target_list, target_dicts, data, params):
- if params['options'].generator_output:
- raise NotImplementedError, "--generator_output not implemented for ninja"
-
user_config = params.get('generator_flags', {}).get('config', None)
if user_config:
GenerateOutputForConfig(target_list, target_dicts, data, params,

0 comments on commit 2ea5a87

Please sign in to comment.