Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / build / gyp_webrtc
index 4d5ae79..edc6b36 100755 (executable)
@@ -20,7 +20,6 @@ script_dir = os.path.dirname(os.path.realpath(__file__))
 checkout_root = os.path.abspath(os.path.join(script_dir, os.pardir, os.pardir))
 
 sys.path.insert(0, os.path.join(checkout_root, 'build'))
-sys.path.insert(0, os.path.join(checkout_root, 'tools', 'find_depot_tools'))
 import gyp_chromium
 import gyp_helper
 import vs_toolchain
@@ -28,6 +27,13 @@ import vs_toolchain
 sys.path.insert(0, os.path.join(checkout_root, 'tools', 'gyp', 'pylib'))
 import gyp
 
+def GetSupplementalFiles():
+  """Returns a list of the supplemental files that are included in all GYP
+  sources."""
+  # Can't use the one in gyp_chromium since the directory location of the root
+  # is different.
+  return glob.glob(os.path.join(checkout_root, '*', 'supplement.gypi'))
+
 
 if __name__ == '__main__':
   args = sys.argv[1:]
@@ -52,7 +58,10 @@ if __name__ == '__main__':
 
   # If we didn't get a file, assume 'all.gyp' in the root of the checkout.
   if not gyp_file_specified:
-    args.append(os.path.join(checkout_root, 'all.gyp'))
+    # Because of a bug in gyp, simply adding the abspath to all.gyp doesn't
+    # work, but chdir'ing and adding the relative path does. Spooky :/
+    os.chdir(checkout_root)
+    args.append('all.gyp')
 
   # There shouldn't be a circular dependency relationship between .gyp files,
   args.append('--no-circular-check')
@@ -68,7 +77,7 @@ if __name__ == '__main__':
   # Enforce gyp syntax checking. This adds about 20% execution time.
   args.append('--check')
 
-  supplemental_includes = gyp_chromium.GetSupplementalFiles()
+  supplemental_includes = GetSupplementalFiles()
   gn_vars_dict = gyp_chromium.GetGypVars(supplemental_includes)
 
   # Automatically turn on crosscompile support for platforms that need it.