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

Side by Side Diff: ppapi/BUILD.gn

Issue 1333673002: Build PPAPI NaCl Glibc tests with GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback addressed Created 5 years, 3 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 | ppapi/native_client/src/untrusted/irt_stub/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 copy("copy_test_files") { 5 copy("copy_test_files") {
6 visibility = [ ":*" ] 6 visibility = [ ":*" ]
7 sources = [ 7 sources = [
8 # Keep "test_case.html.mock-http-headers" with "test_case.html". 8 # Keep "test_case.html.mock-http-headers" with "test_case.html".
9 "tests/ppapi_nacl_tests_newlib.nmf", 9 "tests/ppapi_nacl_tests_newlib.nmf",
10 "tests/test_case.html", 10 "tests/test_case.html",
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 "tools/pepper_hash_for_uma.cc", 138 "tools/pepper_hash_for_uma.cc",
139 ] 139 ]
140 140
141 deps = [ 141 deps = [
142 "//base", 142 "//base",
143 "//build/config/sanitizers:deps", 143 "//build/config/sanitizers:deps",
144 ] 144 ]
145 } 145 }
146 146
147 source_set("ppapi_cpp_lib") { 147 source_set("ppapi_cpp_lib") {
148 if (is_posix) {
149 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
150 }
148 sources = ppapi_sources.cpp_source_files 151 sources = ppapi_sources.cpp_source_files
149 sources += [ 152 sources += [
150 "cpp/module_embedder.h", 153 "cpp/module_embedder.h",
151 "cpp/ppp_entrypoints.cc", 154 "cpp/ppp_entrypoints.cc",
152 ] 155 ]
156 if (is_nacl) {
157 cflags = [ "-fPIC" ]
158 }
159 deps = [
160 "//build/config/nacl:nacl_base",
brettw 2015/09/10 05:02:50 I think you mean to put this inside the is_nacl bl
Petr Hosek 2015/09/11 22:10:49 Done.
161 ]
153 } 162 }
154 163
155 source_set("ppapi_gles2_lib") { 164 source_set("ppapi_gles2_lib") {
156 include_dirs = [ "lib/gl/include" ] 165 include_dirs = [ "lib/gl/include" ]
157 sources = [ 166 sources = [
158 "lib/gl/gles2/gl2ext_ppapi.c", 167 "lib/gl/gles2/gl2ext_ppapi.c",
159 "lib/gl/gles2/gl2ext_ppapi.h", 168 "lib/gl/gles2/gl2ext_ppapi.h",
160 "lib/gl/gles2/gles2.c", 169 "lib/gl/gles2/gles2.c",
161 ] 170 ]
162 deps = [ 171 deps = [
163 "//ppapi/cpp", 172 "//ppapi/cpp",
164 ] 173 ]
165 } 174 }
166 175
167 if (enable_nacl) { 176 if (enable_nacl) {
168 if (is_nacl) { 177 if (is_nacl) {
178 shared_library("ppapi_cpp_lib_shared") {
179 deps = [
180 ":ppapi_cpp_lib",
181 ]
182 }
183
169 executable("ppapi_nacl_tests_newlib") { 184 executable("ppapi_nacl_tests_newlib") {
170 include_dirs = [ 185 include_dirs = [ "lib/gl/include" ]
171 "lib/gl/include",
172 "..",
173 ]
174 186
175 sources = ppapi_sources.test_common_source_files + 187 sources = ppapi_sources.test_common_source_files +
176 ppapi_sources.test_nacl_source_files 188 ppapi_sources.test_nacl_source_files
177 189
178 defines = [ "GL_GLEXT_PROTOTYPES" ] 190 defines = [ "GL_GLEXT_PROTOTYPES" ]
179 191
180 deps = [ 192 deps = [
181 ":ppapi_cpp_lib", 193 ":ppapi_cpp_lib",
182 "//ppapi/native_client:ppapi_lib", 194 "//ppapi/native_client:ppapi_lib",
183 ] 195 ]
184 } 196 }
185 197
198 executable("ppapi_nacl_tests_glibc") {
199 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
200
201 include_dirs = [ "lib/gl/include" ]
202
203 sources = ppapi_sources.test_common_source_files +
204 ppapi_sources.test_nacl_source_files
205
206 defines = [ "GL_GLEXT_PROTOTYPES" ]
207
208 ldflags = [ "-pthread" ]
209
210 deps = [
211 ":ppapi_cpp_lib_shared",
212 "//ppapi/native_client/src/untrusted/irt_stub:ppapi_stub_lib",
213 "//build/config/nacl:nacl_base",
214 ]
215 }
216
186 copy("nacl_tests_copy") { 217 copy("nacl_tests_copy") {
187 sources = [ 218 sources = [
188 "${root_out_dir}/ppapi_nacl_tests_newlib.nexe", 219 "${root_out_dir}/ppapi_nacl_tests_newlib.nexe",
189 ] 220 ]
190 outputs = [ 221 outputs = [
191 "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe", 222 "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe",
192 ] 223 ]
193 deps = [ 224 deps = [
194 ":ppapi_nacl_tests_newlib", 225 ":ppapi_nacl_tests_newlib",
195 ] 226 ]
196 } 227 }
228
229 copy("nacl_glibc_tests_copy") {
230 sources = [
231 "${root_out_dir}/ppapi_nacl_tests_glibc.nexe",
232 ]
233 outputs = [
234 "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe",
brettw 2015/09/10 05:02:50 Actually, I just realized how this should really w
Petr Hosek 2015/09/10 06:25:31 I'm fine to fix it even in this change. Shall I in
Dirk Pranke 2015/09/10 22:27:21 You'll still need the target outputs to have "glib
Petr Hosek 2015/09/11 22:10:49 Done.
235 ]
236 deps = [
237 ":ppapi_nacl_tests_glibc",
238 ]
239 }
240
241 nacl_toolchain_dir = rebase_path("//native_client/toolchain")
242 os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86"
243 glibc_toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc"
244
245 action("generate_glibc_nmf") {
246 glibc_nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf"
247 script = "//native_client_sdk/src/tools/create_nmf.py"
248 sources = get_target_outputs(":nacl_glibc_tests_copy")
249 outputs = [
250 glibc_nmf,
251 ]
252 glibc_nmf_flags = [ "--library-path=" + rebase_path(root_out_dir) ]
253 if (current_cpu == "x86") {
254 libdir_glibc32 = "${glibc_toolchain_dir}/x86_64-nacl/lib32"
255 glibc_nmf_flags +=
256 [ "--library-path=" + rebase_path(libdir_glibc32, root_build_dir) ]
257 }
258 if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) {
259 libdir_glibc64 = "${glibc_toolchain_dir}/x86_64-nacl/lib"
260 glibc_nmf_flags +=
261 [ "--library-path=" + rebase_path(libdir_glibc64, root_build_dir) ]
262 }
263 args = [
264 "--no-default-libpath",
265 "--objdump=${glibc_toolchain_dir}/bin/x86_64-nacl-objdump",
266 "--output=" + rebase_path(glibc_nmf, root_build_dir),
267 "--stage-dependencies=" + rebase_path(root_build_dir),
268 ] + glibc_nmf_flags + rebase_path(sources, root_build_dir)
269 deps = [
270 ":nacl_glibc_tests_copy",
271 ]
272 }
197 } 273 }
198 274
199 group("ppapi_nacl_tests") { 275 group("ppapi_nacl_tests") {
200 deps = [] 276 deps = []
201 if (target_cpu == "x86" || target_cpu == "x64") { 277 if (target_cpu == "x86" || target_cpu == "x64") {
202 deps += [ ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_c pu})" ] 278 deps += [
279 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})",
280 ":generate_glibc_nmf(//build/toolchain/nacl:glibc_${target_cpu})",
281 ]
203 } 282 }
204 } 283 }
205 } 284 }
OLDNEW
« no previous file with comments | « no previous file | ppapi/native_client/src/untrusted/irt_stub/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698