| OLD | NEW |
| 1 # Copyright 2016 Google Inc. | 1 # Copyright 2016 Google Inc. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 declare_args() { | 6 declare_args() { |
| 7 } | 7 } |
| 8 | 8 |
| 9 # Skia public API, generally provided by :skia. | 9 # Skia public API, generally provided by :skia. |
| 10 config("skia_public") { | 10 config("skia_public") { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 "src/sfnt", | 44 "src/sfnt", |
| 45 "src/utils", | 45 "src/utils", |
| 46 "third_party/etc1", | 46 "third_party/etc1", |
| 47 "third_party/ktx", | 47 "third_party/ktx", |
| 48 ] | 48 ] |
| 49 } | 49 } |
| 50 | 50 |
| 51 # Any code that's linked into Skia-the-library should use this config via += ski
a_library_configs. | 51 # Any code that's linked into Skia-the-library should use this config via += ski
a_library_configs. |
| 52 config("skia_library") { | 52 config("skia_library") { |
| 53 visibility = [ ":*" ] | 53 visibility = [ ":*" ] |
| 54 | |
| 55 cflags = [ | |
| 56 "-Winit-self", | |
| 57 "-Wpointer-arith", | |
| 58 "-Wsign-compare", | |
| 59 "-Wvla", | |
| 60 "-fstrict-aliasing", | |
| 61 ] | |
| 62 cflags_cc = [ "-Wnon-virtual-dtor" ] | |
| 63 | |
| 64 defines = [ "SKIA_IMPLEMENTATION=1" ] | 54 defines = [ "SKIA_IMPLEMENTATION=1" ] |
| 65 } | 55 } |
| 66 | 56 |
| 67 skia_library_configs = [ | 57 skia_library_configs = [ |
| 68 ":skia_public", | 58 ":skia_public", |
| 69 ":skia_private", | 59 ":skia_private", |
| 70 ":skia_library", | 60 ":skia_library", |
| 71 ] | 61 ] |
| 72 | 62 |
| 73 if (!defined(is_fuchsia)) { | 63 core_gypi = exec_script("gn/gypi_to_gn.py", |
| 74 is_fuchsia = current_os == "fuchsia" | |
| 75 } | |
| 76 | |
| 77 unwanted_configs = [] | |
| 78 | |
| 79 if (!is_fuchsia) { | |
| 80 # Chrome's GN environment is mostly helpful, but a couple default configs tend
to get in the way. | |
| 81 unwanted_configs += [ | |
| 82 "//build/config/clang:find_bad_constructs", # Chrome style checks. | |
| 83 "//build/config:feature_flags", # A bunch of #defines we don't care about. | |
| 84 ] | |
| 85 } | |
| 86 | |
| 87 core_gypi = exec_script("//build/gypi_to_gn.py", | |
| 88 [ | 64 [ |
| 89 rebase_path("gyp/core.gypi"), | 65 rebase_path("gyp/core.gypi"), |
| 90 "--replace=<(skia_include_path)=include", | 66 "--replace=<(skia_include_path)=include", |
| 91 "--replace=<(skia_src_path)=src", | 67 "--replace=<(skia_src_path)=src", |
| 92 ], | 68 ], |
| 93 "scope", | 69 "scope", |
| 94 [ "gyp/core.gypi" ]) | 70 [ "gyp/core.gypi" ]) |
| 95 | 71 |
| 96 effects_gypi = exec_script("//build/gypi_to_gn.py", | 72 effects_gypi = exec_script("gn/gypi_to_gn.py", |
| 97 [ | 73 [ |
| 98 rebase_path("gyp/effects.gypi"), | 74 rebase_path("gyp/effects.gypi"), |
| 99 "--replace=<(skia_include_path)=include", | 75 "--replace=<(skia_include_path)=include", |
| 100 "--replace=<(skia_src_path)=src", | 76 "--replace=<(skia_src_path)=src", |
| 101 ], | 77 ], |
| 102 "scope", | 78 "scope", |
| 103 [ "gyp/effects.gypi" ]) | 79 [ "gyp/effects.gypi" ]) |
| 104 | 80 |
| 105 gpu_gypi = exec_script("//build/gypi_to_gn.py", | 81 gpu_gypi = exec_script("gn/gypi_to_gn.py", |
| 106 [ | 82 [ |
| 107 rebase_path("gyp/gpu.gypi"), | 83 rebase_path("gyp/gpu.gypi"), |
| 108 "--replace=<(skia_include_path)=include", | 84 "--replace=<(skia_include_path)=include", |
| 109 "--replace=<(skia_src_path)=src", | 85 "--replace=<(skia_src_path)=src", |
| 110 ], | 86 ], |
| 111 "scope", | 87 "scope", |
| 112 [ "gyp/gpu.gypi" ]) | 88 [ "gyp/gpu.gypi" ]) |
| 113 | 89 |
| 114 opts_gypi = exec_script("//build/gypi_to_gn.py", | 90 opts_gypi = exec_script("gn/gypi_to_gn.py", |
| 115 [ | 91 [ |
| 116 rebase_path("gyp/opts.gypi"), | 92 rebase_path("gyp/opts.gypi"), |
| 117 "--replace=<(skia_include_path)=include", | 93 "--replace=<(skia_include_path)=include", |
| 118 "--replace=<(skia_src_path)=src", | 94 "--replace=<(skia_src_path)=src", |
| 119 ], | 95 ], |
| 120 "scope", | 96 "scope", |
| 121 [ "gyp/opts.gypi" ]) | 97 [ "gyp/opts.gypi" ]) |
| 122 | 98 |
| 123 pdf_gypi = exec_script("//build/gypi_to_gn.py", | 99 pdf_gypi = exec_script("gn/gypi_to_gn.py", |
| 124 [ | 100 [ |
| 125 rebase_path("gyp/pdf.gypi"), | 101 rebase_path("gyp/pdf.gypi"), |
| 126 "--replace=<(skia_include_path)=include", | 102 "--replace=<(skia_include_path)=include", |
| 127 "--replace=<(skia_src_path)=src", | 103 "--replace=<(skia_src_path)=src", |
| 128 ], | 104 ], |
| 129 "scope", | 105 "scope", |
| 130 [ "gyp/pdf.gypi" ]) | 106 [ "gyp/pdf.gypi" ]) |
| 131 | 107 |
| 132 utils_gypi = exec_script("//build/gypi_to_gn.py", | 108 utils_gypi = exec_script("gn/gypi_to_gn.py", |
| 133 [ | 109 [ |
| 134 rebase_path("gyp/utils.gypi"), | 110 rebase_path("gyp/utils.gypi"), |
| 135 "--replace=<(skia_include_path)=include", | 111 "--replace=<(skia_include_path)=include", |
| 136 "--replace=<(skia_src_path)=src", | 112 "--replace=<(skia_src_path)=src", |
| 137 ], | 113 ], |
| 138 "scope", | 114 "scope", |
| 139 [ "gyp/utils.gypi" ]) | 115 [ "gyp/utils.gypi" ]) |
| 140 | 116 |
| 141 source_set("opts_ssse3") { | 117 source_set("opts_ssse3") { |
| 142 configs += skia_library_configs | 118 configs += skia_library_configs |
| 143 configs -= unwanted_configs | |
| 144 | 119 |
| 145 sources = opts_gypi.ssse3_sources | 120 sources = opts_gypi.ssse3_sources |
| 146 cflags = [ "-mssse3" ] | 121 cflags = [ "-mssse3" ] |
| 147 } | 122 } |
| 148 | 123 |
| 149 source_set("opts_sse41") { | 124 source_set("opts_sse41") { |
| 150 configs += skia_library_configs | 125 configs += skia_library_configs |
| 151 configs -= unwanted_configs | |
| 152 | 126 |
| 153 sources = opts_gypi.sse41_sources | 127 sources = opts_gypi.sse41_sources |
| 154 cflags = [ "-msse4.1" ] | 128 cflags = [ "-msse4.1" ] |
| 155 } | 129 } |
| 156 | 130 |
| 157 source_set("opts_avx") { | 131 source_set("opts_avx") { |
| 158 configs += skia_library_configs | 132 configs += skia_library_configs |
| 159 configs -= unwanted_configs | |
| 160 | 133 |
| 161 sources = opts_gypi.avx_sources | 134 sources = opts_gypi.avx_sources |
| 162 cflags = [ "-mavx" ] | 135 cflags = [ "-mavx" ] |
| 163 } | 136 } |
| 164 | 137 |
| 165 component("skia") { | 138 component("skia") { |
| 166 public_configs = [ ":skia_public" ] | 139 public_configs = [ ":skia_public" ] |
| 167 configs += skia_library_configs | 140 configs += skia_library_configs |
| 168 configs -= unwanted_configs | |
| 169 | 141 |
| 170 deps = [ | 142 deps = [ |
| 171 ":opts_avx", | 143 ":opts_avx", |
| 172 ":opts_sse41", | 144 ":opts_sse41", |
| 173 ":opts_ssse3", | 145 ":opts_ssse3", |
| 174 "//third_party/zlib", | 146 "//third_party/zlib", |
| 175 ] | 147 ] |
| 176 | 148 |
| 177 libs = [] | 149 libs = [ "pthread" ] |
| 178 | 150 |
| 179 sources = [] | 151 sources = [] |
| 180 sources += core_gypi.sources | 152 sources += core_gypi.sources |
| 181 sources += effects_gypi.sources | 153 sources += effects_gypi.sources |
| 182 sources += gpu_gypi.skgpu_sources | 154 sources += gpu_gypi.skgpu_sources |
| 183 sources += opts_gypi.sse2_sources | 155 sources += opts_gypi.sse2_sources |
| 184 sources += pdf_gypi.sources | 156 sources += pdf_gypi.sources |
| 185 sources += utils_gypi.sources | 157 sources += utils_gypi.sources |
| 186 sources += [ | 158 sources += [ |
| 187 "src/images/SkImageEncoder.cpp", | 159 "src/images/SkImageEncoder.cpp", |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 ] | 219 ] |
| 248 libs += [ "ApplicationServices.framework" ] | 220 libs += [ "ApplicationServices.framework" ] |
| 249 } | 221 } |
| 250 | 222 |
| 251 if (is_fuchsia) { | 223 if (is_fuchsia) { |
| 252 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ] | 224 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ] |
| 253 } | 225 } |
| 254 } | 226 } |
| 255 | 227 |
| 256 executable("example") { | 228 executable("example") { |
| 257 configs -= unwanted_configs | |
| 258 | |
| 259 sources = [ | 229 sources = [ |
| 260 "cmake/example.cpp", | 230 "cmake/example.cpp", |
| 261 ] | 231 ] |
| 262 deps = [ | 232 deps = [ |
| 263 ":skia", | 233 ":skia", |
| 264 ] | 234 ] |
| 265 | 235 |
| 266 libs = [] | 236 libs = [] |
| 267 if (is_mac) { | 237 if (is_mac) { |
| 268 libs += [ "OpenGL.framework" ] | 238 libs += [ "OpenGL.framework" ] |
| 269 } | 239 } |
| 270 } | 240 } |
| OLD | NEW |