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

Side by Side Diff: libvpx.gyp

Issue 130563008: Refactoring unpack_lib_posix and obj_int_extract. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/libvpx
Patch Set: Address comments Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | obj_int_extract.gypi » ('j') | obj_int_extract.gypi » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 { 4 {
5 'variables': { 5 'variables': {
6 'libvpx_build_vp9%': 1, 6 'libvpx_build_vp9%': 1,
7 'libvpx_source%': 'source/libvpx', 7 'libvpx_source%': 'source/libvpx',
8 'conditions': [ 8 'conditions': [
9 ['os_posix==1', { 9 ['os_posix==1', {
10 'asm_obj_extension': 'o', 10 'asm_obj_extension': 'o',
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 # This target is a hard dependency because the generated .asm files 389 # This target is a hard dependency because the generated .asm files
390 # are needed all assembly optimized files in libvpx. 390 # are needed all assembly optimized files in libvpx.
391 'target_name': 'gen_asm_offsets_vp8', 391 'target_name': 'gen_asm_offsets_vp8',
392 'type': 'none', 392 'type': 'none',
393 'hard_dependency': 1, 393 'hard_dependency': 1,
394 'dependencies': [ 394 'dependencies': [
395 'libvpx_asm_offsets_vp8', 395 'libvpx_asm_offsets_vp8',
396 'libvpx_obj_int_extract#host', 396 'libvpx_obj_int_extract#host',
397 ], 397 ],
398 'variables' : { 398 'variables' : {
399 'lib_intermediate_path' : '', 399 'lib_intermediate_name' : '',
400 'output_format':'',
401 'output_dir': '<(shared_generated_dir)',
400 'conditions' : [ 402 'conditions' : [
401 ['android_webview_build==1', { 403 ['android_webview_build==1', {
402 'lib_intermediate_path' : '<(android_src)/$(call intermediates-dir-f or, STATIC_LIBRARIES, libvpx_asm_offsets_vp8)/libvpx_asm_offsets_vp8.a', 404 'lib_intermediate_name' : '<(android_src)/$(call intermediates-dir-f or, STATIC_LIBRARIES, libvpx_asm_offsets_vp8)/libvpx_asm_offsets_vp8.a',
405 }],
406 ['(target_arch=="arm" or target_arch=="armv7")', {
407 'output_format': 'gas',
408 }, {
409 'output_format': 'rvds',
403 }], 410 }],
404 ], 411 ],
405 }, 412 },
406 'conditions': [ 413 'conditions': [
407 ['OS=="win"', { 414 ['OS=="win"', {
408 'variables': { 415 'variables': {
409 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/<(libvpx_sou rce)/vp8', 416 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/<(libvpx_sou rce)/vp8',
410 }, 417 },
411 'actions': [ 418 'actions': [
412 { 419 {
413 'action_name': 'copy_enc_offsets_obj', 420 'action_name': 'copy_enc_offsets_obj',
414 'inputs': [ 'copy_obj.py' ], 421 'inputs': [ 'copy_obj.py' ],
415 'outputs': [ '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.obj' ], 422 'outputs': [ '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.obj' ],
416 'action': [ 423 'action': [
417 'python', 424 'python',
418 '<(DEPTH)/third_party/libvpx/copy_obj.py', 425 '<(DEPTH)/third_party/libvpx/copy_obj.py',
419 '-d', '<@(_outputs)', 426 '-d', '<@(_outputs)',
420 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets_vp8/vp8_asm_enc_off sets.obj', 427 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets_vp8/vp8_asm_enc_off sets.obj',
421 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vp8.vp8_asm_e nc_offsets.obj', 428 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vp8.vp8_asm_e nc_offsets.obj',
422 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/lib vpx/<(libvpx_source)/vp8/encoder/libvpx_asm_offsets_vp8.vp8_asm_enc_offsets.obj' , 429 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/lib vpx/<(libvpx_source)/vp8/encoder/libvpx_asm_offsets_vp8.vp8_asm_enc_offsets.obj' ,
423 ], 430 ],
424 'process_output_as_sources': 1, 431 'process_output_as_sources': 1,
425 }, 432 },
426 ], 433 ],
427 'sources': [ 434 'sources': [
428 '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.obj', 435 '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.obj',
429 ], 436 ],
430 }, { 437 }, {
431 'actions': [ 438 'variables': {
432 { 439 'unpack_lib_search_path_list': [
433 # Take archived .a file and unpack it unto .o files. 440 '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vp8.a',
434 'action_name': 'unpack_lib_posix', 441 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vp8.a',
435 'inputs': [ 442 '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libvpx _asm_offsets_vp8.a',
436 'unpack_lib_posix.sh', 443 '-a', '<(lib_intermediate_name)',
437 ], 444 ],
438 'outputs': [ 445 'unpack_lib_output_dir':'<(INTERMEDIATE_DIR)',
439 '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.o', 446 'unpack_lib_name':'vp8_asm_enc_offsets.o'
440 ], 447 },
441 'action': [ 448 'includes': ['unpack_lib_posix.gypi'],
442 '<(DEPTH)/third_party/libvpx/unpack_lib_posix.sh',
443 '-d', '<(INTERMEDIATE_DIR)',
444 '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vp8.a',
445 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vp8.a',
446 '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libv px_asm_offsets_vp8.a',
447 '-a', '<(lib_intermediate_path)',
448 '-f', 'vp8_asm_enc_offsets.o',
449 ],
450 'process_output_as_sources': 1,
451 },
452 ],
453 # Need this otherwise gyp won't run the rule on them. 449 # Need this otherwise gyp won't run the rule on them.
454 'sources': [ 450 'sources': [
455 '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.o', 451 '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.o',
456 ], 452 ],
457 }], 453 }],
458 ], 454 ],
459 'rules': [ 455 'includes': ['obj_int_extract.gypi'],
460 {
461 # Rule to extract integer values for each symbol from an object file.
462 'rule_name': 'obj_int_extract',
463 'extension': '<(asm_obj_extension)',
464 'inputs': [
465 '<(PRODUCT_DIR)/libvpx_obj_int_extract',
466 'obj_int_extract.py',
467 ],
468 'outputs': [
469 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm',
470 ],
471 'variables': {
472 'conditions': [
473 ['(target_arch=="arm" or target_arch=="armv7")', {
474 'asm_format': 'gas',
475 }, {
476 'asm_format': 'rvds',
477 }],
478 ],
479 },
480 'action': [
481 'python',
482 '<(DEPTH)/third_party/libvpx/obj_int_extract.py',
483 '-e', '<(PRODUCT_DIR)/libvpx_obj_int_extract',
484 '-f', '<(asm_format)',
485 '-b', '<(RULE_INPUT_PATH)',
486 '-o', '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm',
487 ],
488 'message': 'Generate assembly offsets <(RULE_INPUT_PATH)',
489 },
490 ],
491 }, 456 },
492 { 457 {
493 # A target that takes assembly offsets library and generate the 458 # A target that takes assembly offsets library and generate the
494 # corresponding assembly files. 459 # corresponding assembly files.
495 # This target is a hard dependency because the generated .asm files 460 # This target is a hard dependency because the generated .asm files
496 # are needed all assembly optimized files in libvpx. 461 # are needed all assembly optimized files in libvpx.
497 'target_name': 'gen_asm_offsets_vpx_scale', 462 'target_name': 'gen_asm_offsets_vpx_scale',
498 'type': 'none', 463 'type': 'none',
499 'hard_dependency': 1, 464 'hard_dependency': 1,
500 'dependencies': [ 465 'dependencies': [
501 'libvpx_asm_offsets_vpx_scale', 466 'libvpx_asm_offsets_vpx_scale',
502 'libvpx_obj_int_extract#host', 467 'libvpx_obj_int_extract#host',
503 ], 468 ],
504 'variables' : { 469 'variables' : {
505 'lib_intermediate_path' : '', 470 'lib_intermediate_name' : '',
471 'output_format':'',
472 'output_dir': '<(shared_generated_dir)',
506 'conditions' : [ 473 'conditions' : [
507 ['android_webview_build==1', { 474 ['android_webview_build==1', {
508 'lib_intermediate_path' : '<(android_src)/$(call intermediates-dir-f or, STATIC_LIBRARIES, libvpx_asm_offsets_vpx_scale)/libvpx_asm_offsets_vpx_scale .a', 475 'lib_intermediate_name' : '<(android_src)/$(call intermediates-dir-f or, STATIC_LIBRARIES, libvpx_asm_offsets_vpx_scale)/libvpx_asm_offsets_vpx_scale .a',
476 }],
477 ['(target_arch=="arm" or target_arch=="armv7")', {
478 'output_format': 'gas',
479 }, {
480 'output_format': 'rvds',
509 }], 481 }],
510 ], 482 ],
511 }, 483 },
512 'conditions': [ 484 'conditions': [
513 ['OS=="win"', { 485 ['OS=="win"', {
514 'variables': { 486 'variables': {
515 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/<(libvpx_sou rce)/vpx_scale', 487 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/<(libvpx_sou rce)/vpx_scale',
516 }, 488 },
517 'actions': [ 489 'actions': [
518 { 490 {
519 'action_name': 'copy_enc_offsets_obj', 491 'action_name': 'copy_enc_offsets_obj',
520 'inputs': [ 'copy_obj.py' ], 492 'inputs': [ 'copy_obj.py' ],
521 'outputs': [ '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.obj' ], 493 'outputs': [ '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.obj' ],
522 'action': [ 494 'action': [
523 'python', 495 'python',
524 '<(DEPTH)/third_party/libvpx/copy_obj.py', 496 '<(DEPTH)/third_party/libvpx/copy_obj.py',
525 '-d', '<@(_outputs)', 497 '-d', '<@(_outputs)',
526 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets_vpx_scale/vpx_scale _asm_offsets.obj', 498 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets_vpx_scale/vpx_scale _asm_offsets.obj',
527 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vpx_scale.vpx _scale_asm_offsets.obj', 499 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vpx_scale.vpx _scale_asm_offsets.obj',
528 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/lib vpx/<(libvpx_source)/vpx_scale/libvpx_asm_offsets_vpx_scale.vpx_scale_asm_offset s.obj', 500 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/lib vpx/<(libvpx_source)/vpx_scale/libvpx_asm_offsets_vpx_scale.vpx_scale_asm_offset s.obj',
529 ], 501 ],
530 'process_output_as_sources': 1, 502 'process_output_as_sources': 1,
531 }, 503 },
532 ], 504 ],
533 'sources': [ 505 'sources': [
534 '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.obj', 506 '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.obj',
535 ], 507 ],
536 }, { 508 }, {
537 'actions': [ 509 'variables': {
538 { 510 'unpack_lib_search_path_list': [
539 # Take archived .a file and unpack it unto .o files. 511 '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vpx_scale.a',
540 'action_name': 'unpack_lib_posix', 512 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vpx_scale. a',
541 'inputs': [ 513 '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libvpx _asm_offsets_vpx_scale.a',
542 'unpack_lib_posix.sh', 514 '-a', '<(lib_intermediate_name)',
543 ], 515 ],
544 'outputs': [ 516 'unpack_lib_output_dir':'<(INTERMEDIATE_DIR)',
545 '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.o', 517 'unpack_lib_name':'vpx_scale_asm_offsets.o'
546 ], 518 },
547 'action': [ 519 'includes': ['unpack_lib_posix.gypi'],
548 '<(DEPTH)/third_party/libvpx/unpack_lib_posix.sh', 520 # Need this otherwise gyp won't run the rule on them.
549 '-d', '<(INTERMEDIATE_DIR)',
550 '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vpx_scale.a',
551 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vpx_scal e.a',
552 '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libv px_asm_offsets_vpx_scale.a',
553 '-a', '<(lib_intermediate_path)',
554 '-f', 'vpx_scale_asm_offsets.o',
555 ],
556 'process_output_as_sources': 1,
557 },
558 ],
559 # Need this otherwise gyp won't run the rule on them.
560 'sources': [ 521 'sources': [
561 '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.o', 522 '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.o',
562 ], 523 ],
563 }], 524 }],
564 ], 525 ],
565 'rules': [ 526 'includes': ['obj_int_extract.gypi'],
566 {
567 # Rule to extract integer values for each symbol from an object file.
568 'rule_name': 'obj_int_extract',
569 'extension': '<(asm_obj_extension)',
570 'inputs': [
571 '<(PRODUCT_DIR)/libvpx_obj_int_extract',
572 'obj_int_extract.py',
573 ],
574 'outputs': [
575 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm',
576 ],
577 'variables': {
578 'conditions': [
579 ['(target_arch=="arm" or target_arch=="armv7")', {
580 'asm_format': 'gas',
581 }, {
582 'asm_format': 'rvds',
583 }],
584 ],
585 },
586 'action': [
587 'python',
588 '<(DEPTH)/third_party/libvpx/obj_int_extract.py',
589 '-e', '<(PRODUCT_DIR)/libvpx_obj_int_extract',
590 '-f', '<(asm_format)',
591 '-b', '<(RULE_INPUT_PATH)',
592 '-o', '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm',
593 ],
594 'message': 'Generate assembly offsets <(RULE_INPUT_PATH)',
595 },
596 ],
597 }, 527 },
598 { 528 {
599 'target_name': 'simple_encoder', 529 'target_name': 'simple_encoder',
600 'type': 'executable', 530 'type': 'executable',
601 'dependencies': [ 531 'dependencies': [
602 'libvpx', 532 'libvpx',
603 ], 533 ],
604 534
605 # Copy the script to the output folder so that we can use it with 535 # Copy the script to the output folder so that we can use it with
606 # absolute path. 536 # absolute path.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 'process_outputs_as_sources': 1, 596 'process_outputs_as_sources': 1,
667 'message': 'Generate libvpx example code <(RULE_INPUT_PATH)', 597 'message': 'Generate libvpx example code <(RULE_INPUT_PATH)',
668 }, 598 },
669 ], 599 ],
670 'sources': [ 600 'sources': [
671 '<(libvpx_source)/examples/simple_decoder.txt', 601 '<(libvpx_source)/examples/simple_decoder.txt',
672 ] 602 ]
673 }, 603 },
674 ], 604 ],
675 } 605 }
OLDNEW
« no previous file with comments | « no previous file | obj_int_extract.gypi » ('j') | obj_int_extract.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698