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

Side by Side Diff: gyp/common_conditions.gypi

Issue 406613003: Introduce skia_pic gyp variable. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Set fPIE and pie for executables except on Android. Created 6 years, 5 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
« no previous file with comments | « no previous file | gyp/common_variables.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # conditions used in both common.gypi and skia.gyp in chromium 1 # conditions used in both common.gypi and skia.gyp in chromium
2 # 2 #
3 { 3 {
4 'defines': [ 4 'defines': [
5 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)', 5 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
6 'SK_SUPPORT_GPU=<(skia_gpu)', 6 'SK_SUPPORT_GPU=<(skia_gpu)',
7 'SK_SUPPORT_OPENCL=<(skia_opencl)', 7 'SK_SUPPORT_OPENCL=<(skia_opencl)',
8 'SK_FORCE_DISTANCEFIELD_FONTS=<(skia_force_distancefield_fonts)', 8 'SK_FORCE_DISTANCEFIELD_FONTS=<(skia_force_distancefield_fonts)',
9 ], 9 ],
10 'conditions' : [ 10 'conditions' : [
11 ['skia_pic', {
12 'cflags': [
13 '-fPIC',
14 ],
15 'conditions' : [
16 # FIXME: The reason we don't do this on Android is due to the way
17 # we build the executables/skia_launcher on Android. See
18 # https://codereview.chromium.org/406613003/diff/1/gyp/common_conditions.g ypi#newcode455
19 ['skia_os != "android"', {
20 'target_conditions': [
21 [ '_type == "executable"', {
22 'cflags': [ '-fPIE' ],
23 'ldflags': [ '-pie' ],
24 }],
25 ],
26 }],
27 ],
28 }],
11 [ 'skia_arch_type == "arm64"', { 29 [ 'skia_arch_type == "arm64"', {
12 'cflags': [ 30 'cflags': [
13 '-ffp-contract=off', 31 '-ffp-contract=off',
14 ], 32 ],
15 }], 33 }],
16 34
17 # As of M35, Chrome requires SSE2 on x86 (and SSSE3 on Mac). 35 # As of M35, Chrome requires SSE2 on x86 (and SSSE3 on Mac).
18 [ 'skia_arch_type == "x86"', { 36 [ 'skia_arch_type == "x86"', {
19 'cflags': [ 37 'cflags': [
20 '-msse2', 38 '-msse2',
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 }, 414 },
397 'Release': { 415 'Release': {
398 'cflags': [ 416 'cflags': [
399 '-O<(skia_release_optimization_level)', 417 '-O<(skia_release_optimization_level)',
400 ], 418 ],
401 'defines': [ 'NDEBUG' ], 419 'defines': [ 'NDEBUG' ],
402 }, 420 },
403 }, 421 },
404 'conditions' : [ 422 'conditions' : [
405 [ 'skia_shared_lib', { 423 [ 'skia_shared_lib', {
406 'cflags': [
407 '-fPIC',
408 ],
409 'defines': [ 424 'defines': [
410 'SKIA_DLL', 425 'SKIA_DLL',
411 'SKIA_IMPLEMENTATION=1', 426 'SKIA_IMPLEMENTATION=1',
412 ], 427 ],
413 }], 428 }],
414 [ 'skia_os == "nacl"', { 429 [ 'skia_os == "nacl"', {
415 'defines': [ 430 'defines': [
416 'SK_BUILD_FOR_NACL', 431 'SK_BUILD_FOR_NACL',
417 ], 432 ],
418 'variables': { 433 'variables': {
(...skipping 23 matching lines...) Expand all
442 [ 'skia_sanitizer', { 457 [ 'skia_sanitizer', {
443 'cflags': [ 458 'cflags': [
444 '-fsanitize=<(skia_sanitizer)', 459 '-fsanitize=<(skia_sanitizer)',
445 ], 460 ],
446 'ldflags': [ 461 'ldflags': [
447 '-fsanitize=<(skia_sanitizer)', 462 '-fsanitize=<(skia_sanitizer)',
448 ], 463 ],
449 'conditions' : [ 464 'conditions' : [
450 [ 'skia_sanitizer == "thread"', { 465 [ 'skia_sanitizer == "thread"', {
451 'defines': [ 'SK_DYNAMIC_ANNOTATIONS_ENABLED=1' ], 466 'defines': [ 'SK_DYNAMIC_ANNOTATIONS_ENABLED=1' ],
452 'cflags': [ '-fPIC' ],
453 'target_conditions': [
454 [ '_type == "executable"', {
455 'cflags': [ '-fPIE' ],
456 'ldflags': [ '-pie' ],
457 }],
458 ],
459 }], 467 }],
460 [ 'skia_sanitizer == "undefined"', { 468 [ 'skia_sanitizer == "undefined"', {
461 'cflags': [ '-fPIC' ],
462 'cflags_cc!': ['-fno-rtti'], 469 'cflags_cc!': ['-fno-rtti'],
463 'target_conditions': [
464 [ '_type == "executable"', {
465 'cflags': [ '-fPIE' ],
466 'ldflags': [ '-pie' ],
467 }],
468 ],
469 }], 470 }],
470 ], 471 ],
471 }], 472 }],
472 [ 'skia_clang_build', { 473 [ 'skia_clang_build', {
473 'cflags_cc': [ 474 'cflags_cc': [
474 # Build in C++11 mode to make sure we'll have an easy time switc hing. 475 # Build in C++11 mode to make sure we'll have an easy time switc hing.
475 '-std=c++11', 476 '-std=c++11',
476 '-Wno-unknown-warning-option', # Allows unknown warnings. 477 '-Wno-unknown-warning-option', # Allows unknown warnings.
477 '-Wno-deprecated', # From Qt, via debugger (older C lang). 478 '-Wno-deprecated', # From Qt, via debugger (older C lang).
478 '-Wno-deprecated-register', # From Qt, via debugger (newer C lang). 479 '-Wno-deprecated-register', # From Qt, via debugger (newer C lang).
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 [ 'skia_android_framework', { 658 [ 'skia_android_framework', {
658 'libraries!': [ 659 'libraries!': [
659 '-lstdc++', 660 '-lstdc++',
660 '-lm', 661 '-lm',
661 ], 662 ],
662 'cflags!': [ 663 'cflags!': [
663 '-fuse-ld=gold', 664 '-fuse-ld=gold',
664 ], 665 ],
665 }], 666 }],
666 [ 'skia_shared_lib', { 667 [ 'skia_shared_lib', {
667 'cflags': [
668 '-fPIC',
669 ],
670 'defines': [ 668 'defines': [
671 'SKIA_DLL', 669 'SKIA_DLL',
672 'SKIA_IMPLEMENTATION=1', 670 'SKIA_IMPLEMENTATION=1',
673 # Needed until we fix skbug.com/2440. 671 # Needed until we fix skbug.com/2440.
674 'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG', 672 'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
675 ], 673 ],
676 }], 674 }],
677 [ 'skia_profile_enabled == 1', { 675 [ 'skia_profile_enabled == 1', {
678 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'], 676 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
679 }], 677 }],
(...skipping 18 matching lines...) Expand all
698 [ 'skia_crash_handler', { 696 [ 'skia_crash_handler', {
699 'defines': [ 'SK_CRASH_HANDLER' ], 697 'defines': [ 'SK_CRASH_HANDLER' ],
700 }], 698 }],
701 699
702 ], # end 'conditions' 700 ], # end 'conditions'
703 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details 701 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
704 'xcode_settings': { 702 'xcode_settings': {
705 'SYMROOT': '<(DEPTH)/xcodebuild', 703 'SYMROOT': '<(DEPTH)/xcodebuild',
706 }, 704 },
707 } 705 }
OLDNEW
« no previous file with comments | « no previous file | gyp/common_variables.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698