Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/build_shaderc.py

Issue 1884963002: Make build_shaderc.py blow away output dir and allow build_type arg to contain either Debug or Relea (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: shaderc_build_configuration init Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/shaderc.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/build_shaderc.py
diff --git a/tools/build_shaderc.py b/tools/build_shaderc.py
index 0cff599bb1ccb705481077973c450ef3df32116b..93b42bd70e77d760efa9d7a935ce44e254222acf 100644
--- a/tools/build_shaderc.py
+++ b/tools/build_shaderc.py
@@ -36,9 +36,13 @@ def main():
if not os.path.isdir(args.src_dir):
sys.exit(args.src_dir + ' is not a directory.')
-
- if args.build_type != 'Debug' and args.build_type != 'Release':
- sys.exit('Invalid build type: ' + args.build_type);
+
+ if 'Release' in args.build_type:
+ args.build_type = "Release"
+ elif 'Debug' in args.build_type:
+ args.build_type = "Debug"
+ else:
+ args.exit('Invalid build type: ' + args.build_type);
if args.arch_type == 'x86':
vs_arch = ''
@@ -56,11 +60,13 @@ def main():
else:
sys.exit('Invalid project type: ' + args.project_type);
- if not os.path.isdir(args.output_dir):
- try:
- os.makedirs(args.output_dir)
- except os.error:
- sys.exit('Error creating output dir ' + args.output_dir)
+ if os.path.isdir(args.output_dir):
+ shutil.rmtree(args.output_dir)
+
+ try:
+ os.makedirs(args.output_dir)
+ except os.error:
+ sys.exit('Error creating output dir ' + args.output_dir)
try:
build_type_arg='-DCMAKE_BUILD_TYPE=' + args.build_type
« no previous file with comments | « gyp/shaderc.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698