From 5364d8a00fe80083b1b9cf590a3c3e88490204b7 Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Wed, 11 May 2022 07:05:45 +0000 Subject: [PATCH] feat: add PRODUCT_DIR_ABS variable --- pylib/gyp/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pylib/gyp/__init__.py b/pylib/gyp/__init__.py index 6790ef96..976d5b6a 100755 --- a/pylib/gyp/__init__.py +++ b/pylib/gyp/__init__.py @@ -103,6 +103,18 @@ def Load( for (key, val) in generator.generator_default_variables.items(): default_variables.setdefault(key, val) + output_dir = params["options"].generator_output or params["options"].toplevel_dir + if default_variables["GENERATOR"] == "ninja": + default_variables.setdefault( + "PRODUCT_DIR_ABS", + os.path.join(output_dir, "out", default_variables["build_type"]), + ) + else: + default_variables.setdefault( + "PRODUCT_DIR_ABS", + os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]), + ) + # Give the generator the opportunity to set additional variables based on # the params it will receive in the output phase. if getattr(generator, "CalculateVariables", None):