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

Side by Side Diff: third_party/mesa/BUILD.gn

Issue 779473002: gn format //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « third_party/libxml/BUILD.gn ('k') | third_party/mozilla/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 "HAVE_STRINGS_H=1", 42 "HAVE_STRINGS_H=1",
43 "HAVE_INTTYPES_H=1", 43 "HAVE_INTTYPES_H=1",
44 "HAVE_STDINT_H=1", 44 "HAVE_STDINT_H=1",
45 "HAVE_DLFCN_H=1", 45 "HAVE_DLFCN_H=1",
46 "LT_OBJDIR=\".libs/\"", 46 "LT_OBJDIR=\".libs/\"",
47 "YYTEXT_POINTER=1", 47 "YYTEXT_POINTER=1",
48 "HAVE_LIBEXPAT=1", 48 "HAVE_LIBEXPAT=1",
49 "HAVE_LIBXCB_DRI2=1", 49 "HAVE_LIBXCB_DRI2=1",
50 "FEATURE_GL=1", 50 "FEATURE_GL=1",
51 "MAPI_MODE_GLAPI", 51 "MAPI_MODE_GLAPI",
52
52 #"USE_X86_64_ASM", 53 #"USE_X86_64_ASM",
53 "IN_DRI_DRIVER", 54 "IN_DRI_DRIVER",
54 "USE_XCB", 55 "USE_XCB",
55 "GLX_INDIRECT_RENDERING", 56 "GLX_INDIRECT_RENDERING",
56 "GLX_DIRECT_RENDERING", 57 "GLX_DIRECT_RENDERING",
57 "USE_EXTERNAL_DXTN_LIB=1", 58 "USE_EXTERNAL_DXTN_LIB=1",
58 "IN_DRI_DRIVER", 59 "IN_DRI_DRIVER",
59 "HAVE_ALIAS", 60 "HAVE_ALIAS",
60 "HAVE_MINCORE", 61 "HAVE_MINCORE",
61 "HAVE_LIBUDEV", 62 "HAVE_LIBUDEV",
(...skipping 20 matching lines...) Expand all
82 } 83 }
83 84
84 if (is_android) { 85 if (is_android) {
85 defines += [ 86 defines += [
86 "__GLIBC__", 87 "__GLIBC__",
87 "_GNU_SOURCE", 88 "_GNU_SOURCE",
88 ] 89 ]
89 } 90 }
90 91
91 if (is_linux) { 92 if (is_linux) {
92 defines += [ 93 defines += [ "_GNU_SOURCE" ]
93 "_GNU_SOURCE",
94 ]
95 } 94 }
96 95
97 if (is_posix) { 96 if (is_posix) {
98 defines += [ 97 defines += [
99 "HAVE_DLOPEN", 98 "HAVE_DLOPEN",
100 "HAVE_PTHREAD=1", 99 "HAVE_PTHREAD=1",
101 "HAVE_UNISTD_H=1", 100 "HAVE_UNISTD_H=1",
102 ] 101 ]
103 102
104 if (!is_android) { 103 if (!is_android) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 "src/src/glsl/opt_noop_swizzle.cpp", 215 "src/src/glsl/opt_noop_swizzle.cpp",
217 "src/src/glsl/opt_redundant_jumps.cpp", 216 "src/src/glsl/opt_redundant_jumps.cpp",
218 "src/src/glsl/opt_structure_splitting.cpp", 217 "src/src/glsl/opt_structure_splitting.cpp",
219 "src/src/glsl/opt_swizzle_swizzle.cpp", 218 "src/src/glsl/opt_swizzle_swizzle.cpp",
220 "src/src/glsl/opt_tree_grafting.cpp", 219 "src/src/glsl/opt_tree_grafting.cpp",
221 "src/src/glsl/program.h", 220 "src/src/glsl/program.h",
222 "src/src/glsl/ralloc.c", 221 "src/src/glsl/ralloc.c",
223 "src/src/glsl/ralloc.h", 222 "src/src/glsl/ralloc.h",
224 "src/src/glsl/s_expression.cpp", 223 "src/src/glsl/s_expression.cpp",
225 "src/src/glsl/s_expression.h", 224 "src/src/glsl/s_expression.h",
225
226 # Skipped in the GN build. This file duplicates symbols from errors.c and 226 # Skipped in the GN build. This file duplicates symbols from errors.c and
227 # happens to link in GYP due to static library link ordering. 227 # happens to link in GYP due to static library link ordering.
228 #"src/src/glsl/standalone_scaffolding.cpp", 228 #"src/src/glsl/standalone_scaffolding.cpp",
229 #"src/src/glsl/standalone_scaffolding.h", 229 #"src/src/glsl/standalone_scaffolding.h",
230 "src/src/glsl/strtod.c", 230 "src/src/glsl/strtod.c",
231 "src/src/glsl/strtod.h", 231 "src/src/glsl/strtod.h",
232 ] 232 ]
233 233
234 configs -= [ 234 configs -= [ "//build/config/compiler:chromium_code" ]
235 "//build/config/compiler:chromium_code", 235 configs += [ "//build/config/compiler:no_chromium_code" ]
236 ]
237 configs += [
238 "//build/config/compiler:no_chromium_code",
239 ]
240 previous_configs = configs 236 previous_configs = configs
241 configs = [] 237 configs = []
242 configs = [ ":mesa_internal_config" ] + previous_configs 238 configs = [ ":mesa_internal_config" ] + previous_configs
243 239
244 if (is_clang) { 240 if (is_clang) {
245 # Mesa triggers some of these Clang warnings. 241 # Mesa triggers some of these Clang warnings.
246 configs -= [ "//build/config/clang:extra_warnings" ] 242 configs -= [ "//build/config/clang:extra_warnings" ]
247 } 243 }
248 244
249 deps = [ 245 deps = [
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 "src/src/mesa/vbo/vbo_save_draw.c", 606 "src/src/mesa/vbo/vbo_save_draw.c",
611 "src/src/mesa/vbo/vbo_save_loopback.c", 607 "src/src/mesa/vbo/vbo_save_loopback.c",
612 "src/src/mesa/vbo/vbo_split.c", 608 "src/src/mesa/vbo/vbo_split.c",
613 "src/src/mesa/vbo/vbo_split.h", 609 "src/src/mesa/vbo/vbo_split.h",
614 "src/src/mesa/vbo/vbo_split_copy.c", 610 "src/src/mesa/vbo/vbo_split_copy.c",
615 "src/src/mesa/vbo/vbo_split_inplace.c", 611 "src/src/mesa/vbo/vbo_split_inplace.c",
616 "src/src/mesa/x86-64/x86-64.c", 612 "src/src/mesa/x86-64/x86-64.c",
617 "src/src/mesa/x86-64/x86-64.h", 613 "src/src/mesa/x86-64/x86-64.h",
618 ] 614 ]
619 615
620 configs -= [ 616 configs -= [ "//build/config/compiler:chromium_code" ]
621 "//build/config/compiler:chromium_code", 617 configs += [ "//build/config/compiler:no_chromium_code" ]
622 ]
623 configs += [
624 "//build/config/compiler:no_chromium_code",
625 ]
626 previous_configs = configs 618 previous_configs = configs
627 configs = [] 619 configs = []
628 configs = [ ":mesa_internal_config" ] + previous_configs 620 configs = [ ":mesa_internal_config" ] + previous_configs
629 621
630 cflags = [] 622 cflags = []
631 623
632 if (is_clang) { 624 if (is_clang) {
633 cflags += [ "-Wno-absolute-value" ] 625 cflags += [ "-Wno-absolute-value" ]
634 } 626 }
635 627
636 if (is_android && !is_clang) { 628 if (is_android && !is_clang) {
637 # Disable sincos() optimization to avoid a linker error 629 # Disable sincos() optimization to avoid a linker error
638 # since Android's math library doesn't have sincos(). 630 # since Android's math library doesn't have sincos().
639 # Either -fno-builtin-sin or -fno-builtin-cos works. 631 # Either -fno-builtin-sin or -fno-builtin-cos works.
640 cflags += [ "-fno-builtin-sin" ] 632 cflags += [ "-fno-builtin-sin" ]
641 } 633 }
642 634
643 if (is_win) { 635 if (is_win) {
644 # Because we're building as a static library 636 # Because we're building as a static library
645 defines = [ "_GLAPI_NO_EXPORTS" ] 637 defines = [ "_GLAPI_NO_EXPORTS" ]
646 } 638 }
647 639
648 deps = [ 640 deps = [
649 ":mesa_headers", 641 ":mesa_headers",
650 ] 642 ]
651 } 643 }
652 644
653 if (!is_android) { # TODO(GYP) enable for Android. 645 if (!is_android) { # TODO(GYP) enable for Android.
646 # Building this target will hide the native OpenGL shared library and
647 # replace it with a slow software renderer.
648 # TODO(GYP) http://crbug.com/380327 need support for loadable_module.
649 #loadable_module("osmesa") {
650 shared_library("osmesa") {
651 sources = [
652 "src/src/mesa/drivers/common/driverfuncs.c",
653 "src/src/mesa/drivers/common/driverfuncs.h",
654 "src/src/mesa/drivers/common/meta.c",
655 "src/src/mesa/drivers/common/meta.h",
656 "src/src/mesa/drivers/osmesa/osmesa.c",
657 "src/src/mesa/drivers/osmesa/osmesa.def",
658 ]
654 659
655 # Building this target will hide the native OpenGL shared library and 660 configs -= [ "//build/config/compiler:chromium_code" ]
656 # replace it with a slow software renderer. 661 configs += [
657 # TODO(GYP) http://crbug.com/380327 need support for loadable_module. 662 ":mesa_headers_config",
658 #loadable_module("osmesa") { 663 "//build/config/compiler:no_chromium_code",
659 shared_library("osmesa") { 664 ]
660 sources = [ 665 previous_configs = configs
661 "src/src/mesa/drivers/common/driverfuncs.c", 666 configs = []
662 "src/src/mesa/drivers/common/driverfuncs.h", 667 configs = [ ":mesa_internal_config" ] + previous_configs
663 "src/src/mesa/drivers/common/meta.c",
664 "src/src/mesa/drivers/common/meta.h",
665 "src/src/mesa/drivers/osmesa/osmesa.c",
666 "src/src/mesa/drivers/osmesa/osmesa.def",
667 ]
668 668
669 configs -= [ 669 include_dirs = [ "src/src/mesa/drivers" ]
670 "//build/config/compiler:chromium_code",
671 ]
672 configs += [
673 ":mesa_headers_config",
674 "//build/config/compiler:no_chromium_code",
675 ]
676 previous_configs = configs
677 configs = []
678 configs = [ ":mesa_internal_config" ] + previous_configs
679 670
680 include_dirs = [ "src/src/mesa/drivers" ] 671 if (is_clang) {
672 # Mesa triggers some of these Clang warnings.
673 configs -= [ "//build/config/clang:extra_warnings" ]
674 }
681 675
682 if (is_clang) { 676 deps = [
683 # Mesa triggers some of these Clang warnings. 677 ":mesa_headers",
684 configs -= [ "//build/config/clang:extra_warnings" ] 678 ":mesa",
679 ":mesa_libglslcommon",
680 ]
681
682 if (is_win) {
683 defines = [
684 "BUILD_GL32",
685 "KEYWORD1=GLAPI",
686 "KEYWORD2=GLAPIENTRY",
687 ]
688 }
685 } 689 }
686
687 deps = [
688 ":mesa_headers",
689 ":mesa",
690 ":mesa_libglslcommon",
691 ]
692
693 if (is_win) {
694 defines = [
695 "BUILD_GL32",
696 "KEYWORD1=GLAPI",
697 "KEYWORD2=GLAPIENTRY",
698 ]
699 }
700 }
701
702 } # !is_android 690 } # !is_android
703
704 # TODO(GYP) Android osmesa_in_lib_dir target. 691 # TODO(GYP) Android osmesa_in_lib_dir target.
OLDNEW
« no previous file with comments | « third_party/libxml/BUILD.gn ('k') | third_party/mozilla/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698