OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 import("//third_party/openh264/openh264_args.gni") | |
6 | |
7 if (use_openh264) { | |
8 # Import source and include variables from openh264.gypi. | |
9 openh264_gypi_values = exec_script("//build/gypi_to_gn.py", | |
10 [ rebase_path("openh264.gypi") ], | |
11 "scope") | |
12 | |
13 # Config shared by all openh264 targets. | |
14 config("openh264_config") { | |
15 cflags = [] | |
16 defines = [] | |
17 | |
18 # Compiler warnings to ignore. | |
19 if (!is_win) { | |
20 # GCC flags | |
21 cflags += [ | |
22 "-Wno-header-hygiene", | |
23 "-Wno-unused-value", | |
24 ] | |
25 } | |
26 | |
27 # Platform-specific defines. | |
28 if (is_android) { | |
29 defines += [ "ANDROID_NDK" ] | |
brettw
2015/11/24 00:05:19
Can you comment why this is necessary?
hbos_chromium
2015/11/25 16:17:02
Done.
| |
30 } | |
31 | |
32 # Workaround relating to the VERSION_NUMBER macro in version.h. | |
33 # TODO(hbos): Fix cause of the issue instead of this workaround. | |
34 if (!is_android) { | |
35 # On some builds VERSION_NUMBER is not defined when including version.h | |
36 # (probably another file is included named version.h, I have not been able | |
37 # to reproduce the problem on a local machine). Since the macro is only | |
38 # used for debug printing in wels[En/De]coderExt.cpp we can get around the | |
39 # undeclared identifier error by giving it a default value ourselves. | |
40 defines += [ "VERSION_NUMBER=\"openh264 v.?.?\"" ] | |
brettw
2015/11/24 00:05:19
This seems pretty fishy. If your include directori
hbos_chromium
2015/11/25 16:17:02
Can't remember if I had this problem on GN or not.
hbos_chromium
2015/11/25 16:56:44
Oh wow, thanks a million, I got rid of it with you
| |
41 | |
42 # For other builds we end up with a macro redefinition and have to | |
43 # suppress the macro redefined warning. Suppressing it does not work on | |
44 # android, but that's OK because we do not have the version.h problem on | |
45 # android, thus the if (!is_android) above. | |
46 if (!is_win) { | |
47 # GCC flags | |
48 cflags += [ "-Wno-macro-redefined" ] | |
49 } else { | |
50 # MSVC flags | |
51 cflags += [ "/wd4005" ] # macro redefinition | |
52 } | |
53 } | |
54 } | |
55 | |
56 source_set("openh264_common") { | |
brettw
2015/11/24 00:05:19
These names should not duplicate the directory nam
hbos_chromium
2015/11/25 16:17:02
Are you sure? They're the names used when you ninj
brettw
2015/11/25 19:26:34
Yes. GN style is to not duplicate names like this.
hbos_chromium
2015/11/26 12:19:24
Done.
| |
57 sources = openh264_gypi_values.openh264_common_sources | |
58 include_dirs = openh264_gypi_values.openh264_common_includes | |
59 configs -= [ "//build/config/compiler:chromium_code" ] | |
60 configs += [ "//build/config/compiler:no_chromium_code" ] | |
61 configs += [ ":openh264_config" ] | |
62 deps = [] | |
63 if (is_android) { | |
64 deps += [ | |
65 # Defines "android_get/setCpu..." functions. The original OpenH264 build | |
66 # files replaces these using macros for "wels_..." versions of the same | |
67 # functions. We do not have access to these and use the <cpu-features.h> | |
68 # ones instead. | |
69 "//third_party/android_tools:cpu_features", | |
70 ] | |
71 } | |
72 } | |
73 | |
74 source_set("openh264_processing") { | |
75 sources = openh264_gypi_values.openh264_processing_sources | |
76 include_dirs = openh264_gypi_values.openh264_processing_includes | |
77 configs -= [ "//build/config/compiler:chromium_code" ] | |
78 configs += [ "//build/config/compiler:no_chromium_code" ] | |
79 configs += [ ":openh264_config" ] | |
80 deps = [ | |
81 ":openh264_common", | |
82 ] | |
83 } | |
84 | |
85 source_set("openh264_encoder") { | |
86 sources = openh264_gypi_values.openh264_encoder_sources | |
87 include_dirs = openh264_gypi_values.openh264_encoder_includes | |
88 configs -= [ "//build/config/compiler:chromium_code" ] | |
89 configs += [ "//build/config/compiler:no_chromium_code" ] | |
90 configs += [ ":openh264_config" ] | |
91 deps = [ | |
92 ":openh264_common", | |
93 ":openh264_processing", | |
94 ] | |
95 } | |
96 | |
97 source_set("openh264_decoder") { | |
98 sources = openh264_gypi_values.openh264_decoder_sources | |
99 include_dirs = openh264_gypi_values.openh264_decoder_includes | |
100 configs -= [ "//build/config/compiler:chromium_code" ] | |
101 configs += [ "//build/config/compiler:no_chromium_code" ] | |
102 configs += [ ":openh264_config" ] | |
103 deps = [ | |
104 ":openh264_common", | |
105 ":openh264_processing", | |
106 ] | |
107 defines = [ | |
108 # Disables decoder_core.cpp debug prints. | |
109 "CODEC_FOR_TESTBED", | |
110 ] | |
111 } | |
112 } | |
OLD | NEW |