diff options
author | Sean Callanan <spyffe@google.com> | 2019-11-21 17:43:42 -0800 |
---|---|---|
committer | Sean Callanan <spyffe@google.com> | 2019-11-21 17:43:42 -0800 |
commit | c0ddd3527db861c092af6b16d55632444f2350e1 (patch) | |
tree | 2a8f2cea613e9a3000704082f27b8b818a9f7634 | |
parent | 2a34a0418e367b5b3948f0b62a29922ee6a76f78 (diff) | |
download | platform_external_igt-gpu-tools-c0ddd3527db861c092af6b16d55632444f2350e1.tar.gz platform_external_igt-gpu-tools-c0ddd3527db861c092af6b16d55632444f2350e1.tar.bz2 platform_external_igt-gpu-tools-c0ddd3527db861c092af6b16d55632444f2350e1.zip |
igt-gpu-tools: Extract common code into a library
igt-gpu-tools is basically a library for making tests. To simplify
writing individual tests, extracted all the common code into a static
library and allowed tests to reuse a common set of defaults.
Bug: 142890405
Test: built gem_blt successfully
Change-Id: Ia435530ae02d782d70a574276ad9e4d426decde2
-rw-r--r-- | Android.bp | 49 |
1 files changed, 32 insertions, 17 deletions
@@ -1,7 +1,23 @@ -cc_test { - name: "gem_blt", +cc_defaults { + name: "igt-gpu-tools-defaults", + cflags: [ + "-Wall", + "-Werror", + "-Wno-missing-field-initializers", + "-Wno-unused-parameter", + "-Wno-unused-variable", + "-DHAVE_GETTID", + "-DHAVE_LIBGEN_H", + "-DHAVE_MEMFD_CREATE", + ], + static_libs: ["libelf", "libkmod"], + shared_libs: ["libdrm", "libunwind"], +} + +cc_library_static { + name: "igt-gpu-tools", + defaults: ["igt-gpu-tools-defaults"], srcs: [ - "benchmarks/gem_blt.c", "lib/drmtest.c", "lib/igt_aux.c", "lib/igt_core.c", @@ -12,22 +28,21 @@ cc_test { "lib/ioctl_wrappers.c", "lib/i915/gem_mman.c", ], - cflags: [ - "-Wall", - "-Werror", - "-Wno-missing-field-initializers", - "-Wno-unused-parameter", - "-Wno-unused-variable", - "-DHAVE_GETTID", - "-DHAVE_LIBGEN_H", - "-DHAVE_MEMFD_CREATE", - ], - local_include_dirs: [ + export_include_dirs: [ "lib", "lib/stubs/drm", "prebuilt-intermediates", ], - static_libs: ["libelf", "libkmod"], - shared_libs: ["libdrm", "libunwind"], - stl: "none", +} + +cc_defaults { + name: "igt-gpu-tools-test-defaults", + defaults: ["igt-gpu-tools-defaults"], + static_libs: ["igt-gpu-tools"], +} + +cc_test { + name: "gem_blt", + defaults: ["igt-gpu-tools-test-defaults"], + srcs: ["benchmarks/gem_blt.c"], } |