OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/ui.gni") | 5 import("//build/config/ui.gni") |
6 | 6 |
7 config("mesa_headers_config") { | 7 config("mesa_headers_config") { |
8 include_dirs = [ "src/include" ] | 8 include_dirs = [ "src/include" ] |
9 if (use_x11) { | 9 if (use_x11) { |
10 defines = [ "MESA_EGL_NO_X11_HEADERS" ] | 10 defines = [ "MESA_EGL_NO_X11_HEADERS" ] |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 "src/src/mapi/glapi", | 71 "src/src/mapi/glapi", |
72 "src/src/mesa", | 72 "src/src/mesa", |
73 "src/src/mesa/main", | 73 "src/src/mesa/main", |
74 "src/include", | 74 "src/include", |
75 "$generated_src_dir/mesa/", | 75 "$generated_src_dir/mesa/", |
76 "$generated_src_dir/mesa/main", | 76 "$generated_src_dir/mesa/main", |
77 "$generated_src_dir/mesa/program", | 77 "$generated_src_dir/mesa/program", |
78 "$generated_src_dir/mesa/glapi", | 78 "$generated_src_dir/mesa/glapi", |
79 ] | 79 ] |
80 | 80 |
81 if (is_clang) { | |
82 cflags += [ "-Wno-tautological-constant-out-of-range-compare" ] | |
83 } | |
84 | |
85 if (is_android) { | 81 if (is_android) { |
86 defines += [ | 82 defines += [ |
87 "__GLIBC__", | 83 "__GLIBC__", |
88 "_GNU_SOURCE", | 84 "_GNU_SOURCE", |
89 ] | 85 ] |
90 } | 86 } |
91 | 87 |
92 if (is_linux) { | 88 if (is_linux) { |
93 defines += [ "_GNU_SOURCE" ] | 89 defines += [ "_GNU_SOURCE" ] |
94 } | 90 } |
95 | 91 |
96 if (is_posix) { | 92 if (is_posix) { |
97 defines += [ | 93 defines += [ |
98 "HAVE_DLOPEN", | 94 "HAVE_DLOPEN", |
99 "HAVE_PTHREAD=1", | 95 "HAVE_PTHREAD=1", |
100 "HAVE_UNISTD_H=1", | 96 "HAVE_UNISTD_H=1", |
101 ] | 97 ] |
102 | 98 |
103 if (!is_android) { | 99 if (!is_android) { |
104 defines += [ "HAVE_POSIX_MEMALIGN" ] | 100 defines += [ "HAVE_POSIX_MEMALIGN" ] |
105 } | 101 } |
106 | 102 |
107 if (!is_android && !is_mac) { | 103 if (!is_android && !is_mac) { |
108 cflags += [ "-fPIC" ] | 104 cflags += [ "-fPIC" ] |
109 } | 105 } |
110 } | 106 } |
| 107 } |
111 | 108 |
| 109 # mesa_internal_config is prepended to the config lists. Flags that |
| 110 # disable warnings need to be appended instead so that they show up |
| 111 # after flags like -Wall. (gn orders flags on a target before flags from |
| 112 # configs.) |
| 113 config("mesa_internal_warnings") { |
| 114 cflags = [] |
| 115 if (is_clang) { |
| 116 cflags += [ |
| 117 "-Wno-tautological-constant-out-of-range-compare", |
| 118 "-Wno-mismatched-tags", # Fixed upstream. |
| 119 ] |
| 120 } |
112 if (is_win) { | 121 if (is_win) { |
113 # TODO(scottmg): http://crbug.com/143877 These should be removed if | 122 # TODO(scottmg): http://crbug.com/143877 These should be removed if |
114 # Mesa is ever rolled and the warnings are fixed. | 123 # Mesa is ever rolled and the warnings are fixed. |
115 cflags += [ | 124 cflags += [ |
116 "/wd4005", # Macro defined twice. | 125 "/wd4005", # Macro defined twice. |
117 "/wd4065", # Switch statement contains 'default' but no 'case' labels. | 126 "/wd4065", # Switch statement contains 'default' but no 'case' labels. |
118 "/wd4090", # 'Operation' : different 'modifier' qualifiers | 127 "/wd4090", # 'Operation' : different 'modifier' qualifiers |
119 "/wd4099", # Type name struct-vs-class doesn't match. | 128 "/wd4099", # Type name struct-vs-class doesn't match. |
120 "/wd4267", # size_t to type. | |
121 "/wd4273", # Inconsistent DLL linkage. | 129 "/wd4273", # Inconsistent DLL linkage. |
122 "/wd4291", # No matching operator delete found for placement new. | 130 "/wd4291", # No matching operator delete found for placement new. |
123 "/wd4305", # Truncation from int to float. | 131 "/wd4305", # Truncation from int to float. |
124 "/wd4334", # Result of 32-bit shift implicitly converted to 64 bits. | 132 "/wd4334", # Result of 32-bit shift implicitly converted to 64 bits. |
125 "/wd4345", # POD-type default initializers. | 133 "/wd4345", # POD-type default initializers. |
126 ] | 134 ] |
127 } | 135 } |
128 } | 136 } |
129 | 137 |
130 static_library("mesa_libglslcommon") { | 138 static_library("mesa_libglslcommon") { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 #"src/src/glsl/standalone_scaffolding.cpp", | 236 #"src/src/glsl/standalone_scaffolding.cpp", |
229 #"src/src/glsl/standalone_scaffolding.h", | 237 #"src/src/glsl/standalone_scaffolding.h", |
230 "src/src/glsl/strtod.c", | 238 "src/src/glsl/strtod.c", |
231 "src/src/glsl/strtod.h", | 239 "src/src/glsl/strtod.h", |
232 ] | 240 ] |
233 | 241 |
234 configs -= [ "//build/config/compiler:chromium_code" ] | 242 configs -= [ "//build/config/compiler:chromium_code" ] |
235 configs += [ "//build/config/compiler:no_chromium_code" ] | 243 configs += [ "//build/config/compiler:no_chromium_code" ] |
236 previous_configs = configs | 244 previous_configs = configs |
237 configs = [] | 245 configs = [] |
238 configs = [ ":mesa_internal_config" ] + previous_configs | 246 configs = [ ":mesa_internal_config" ] + previous_configs + |
| 247 [ ":mesa_internal_warnings" ] |
239 | 248 |
240 if (is_clang) { | 249 if (is_clang) { |
241 # Mesa triggers some of these Clang warnings. | 250 # Mesa triggers some of these Clang warnings. |
242 configs -= [ "//build/config/clang:extra_warnings" ] | 251 configs -= [ "//build/config/clang:extra_warnings" ] |
243 } | 252 } |
244 | 253 |
245 deps = [ | 254 deps = [ |
246 ":mesa_headers", | 255 ":mesa_headers", |
247 ] | 256 ] |
248 } | 257 } |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 "src/src/mesa/vbo/vbo_split_copy.c", | 619 "src/src/mesa/vbo/vbo_split_copy.c", |
611 "src/src/mesa/vbo/vbo_split_inplace.c", | 620 "src/src/mesa/vbo/vbo_split_inplace.c", |
612 "src/src/mesa/x86-64/x86-64.c", | 621 "src/src/mesa/x86-64/x86-64.c", |
613 "src/src/mesa/x86-64/x86-64.h", | 622 "src/src/mesa/x86-64/x86-64.h", |
614 ] | 623 ] |
615 | 624 |
616 configs -= [ "//build/config/compiler:chromium_code" ] | 625 configs -= [ "//build/config/compiler:chromium_code" ] |
617 configs += [ "//build/config/compiler:no_chromium_code" ] | 626 configs += [ "//build/config/compiler:no_chromium_code" ] |
618 previous_configs = configs | 627 previous_configs = configs |
619 configs = [] | 628 configs = [] |
620 configs = [ ":mesa_internal_config" ] + previous_configs | 629 configs = [ ":mesa_internal_config" ] + previous_configs + |
| 630 [ ":mesa_internal_warnings" ] |
621 | 631 |
622 if (is_clang) { | 632 if (is_clang) { |
623 # Mesa triggers some of these Clang warnings. | 633 # Mesa triggers some of these Clang warnings. |
624 configs -= [ "//build/config/clang:extra_warnings" ] | 634 configs -= [ "//build/config/clang:extra_warnings" ] |
625 } | 635 } |
626 | 636 |
627 cflags = [] | 637 cflags = [] |
628 | 638 |
629 if (is_android && !is_clang) { | 639 if (is_android && !is_clang) { |
630 # Disable sincos() optimization to avoid a linker error | 640 # Disable sincos() optimization to avoid a linker error |
(...skipping 27 matching lines...) Expand all Loading... |
658 "src/src/mesa/drivers/osmesa/osmesa.def", | 668 "src/src/mesa/drivers/osmesa/osmesa.def", |
659 ] | 669 ] |
660 | 670 |
661 configs -= [ "//build/config/compiler:chromium_code" ] | 671 configs -= [ "//build/config/compiler:chromium_code" ] |
662 configs += [ | 672 configs += [ |
663 ":mesa_headers_config", | 673 ":mesa_headers_config", |
664 "//build/config/compiler:no_chromium_code", | 674 "//build/config/compiler:no_chromium_code", |
665 ] | 675 ] |
666 previous_configs = configs | 676 previous_configs = configs |
667 configs = [] | 677 configs = [] |
668 configs = [ ":mesa_internal_config" ] + previous_configs | 678 configs = [ ":mesa_internal_config" ] + previous_configs + |
| 679 [ ":mesa_internal_warnings" ] |
669 | 680 |
670 include_dirs = [ "src/src/mesa/drivers" ] | 681 include_dirs = [ "src/src/mesa/drivers" ] |
671 | 682 |
672 if (is_clang) { | 683 if (is_clang) { |
673 # Mesa triggers some of these Clang warnings. | 684 # Mesa triggers some of these Clang warnings. |
674 configs -= [ "//build/config/clang:extra_warnings" ] | 685 configs -= [ "//build/config/clang:extra_warnings" ] |
675 } | 686 } |
676 | 687 |
677 deps = [ | 688 deps = [ |
678 ":mesa_headers", | 689 ":mesa_headers", |
679 ":mesa", | 690 ":mesa", |
680 ":mesa_libglslcommon", | 691 ":mesa_libglslcommon", |
681 ] | 692 ] |
682 | 693 |
683 if (is_win) { | 694 if (is_win) { |
684 defines = [ | 695 defines = [ |
685 "BUILD_GL32", | 696 "BUILD_GL32", |
686 "KEYWORD1=GLAPI", | 697 "KEYWORD1=GLAPI", |
687 "KEYWORD2=GLAPIENTRY", | 698 "KEYWORD2=GLAPIENTRY", |
688 ] | 699 ] |
689 } | 700 } |
690 } | 701 } |
691 } else { | 702 } else { |
692 # Placeholder to allow targets to unconditionally depend on this. | 703 # Placeholder to allow targets to unconditionally depend on this. |
693 group("osmesa") { | 704 group("osmesa") { |
694 } | 705 } |
695 } # !is_android | 706 } # !is_android |
696 # TODO(GYP) Android osmesa_in_lib_dir target. | 707 # TODO(GYP) Android osmesa_in_lib_dir target. |
OLD | NEW |