• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17// This produces human-readable asm_defines.s with the embedded compile-time constants.
18package {
19    // See: http://go/android-license-faq
20    // A large-scale-change added 'default_applicable_licenses' to import
21    // all of the 'license_kinds' from "art_license"
22    // to get the below license kinds:
23    //   SPDX-license-identifier-Apache-2.0
24    default_applicable_licenses: ["art_license"],
25}
26
27cc_object {
28    name: "asm_defines.s",
29    host_supported: true,
30    device_supported: true,
31    defaults: ["art_debug_defaults"],
32    header_libs: [
33        "art_libartbase_headers", // For base/bit_utils.h
34        "jni_headers",
35        "libart_headers",
36        "libdexfile_all_headers", // For dex/modifiers.h
37    ],
38    // Produce text file rather than binary.
39    cflags: ["-S"],
40    srcs: ["asm_defines.cc"],
41    apex_available: [
42        "com.android.art",
43        "com.android.art.debug",
44    ],
45}
46
47// This extracts the compile-time constants from asm_defines.s and creates the header.
48cc_genrule {
49    name: "cpp-define-generator-asm-support",
50    host_supported: true,
51    device_supported: true,
52    srcs: [":asm_defines.s"],
53    out: ["asm_defines.h"],
54    tool_files: ["make_header.py"],
55    cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"",
56    target: {
57        darwin: {
58            enabled: false,
59        },
60        windows: {
61            // When the module is enabled globally in the soong_config_variables
62            // stanza above, it gets enabled on windows too. Hence we need to
63            // disable it explicitly.
64            // TODO(b/172480617): Clean up with that.
65            enabled: false,
66        },
67    },
68
69    apex_available: [
70        "com.android.art",
71        "com.android.art.debug",
72    ],
73}
74
75cc_library_headers {
76    name: "cpp-define-generator-definitions",
77    defaults: ["art_defaults"],
78    host_supported: true,
79    export_include_dirs: ["."],
80
81    apex_available: [
82        "com.android.art",
83        "com.android.art.debug",
84    ],
85}
86
87python_binary_host {
88    name: "cpp-define-generator-test",
89    main: "make_header_test.py",
90    srcs: [
91        "make_header.py",
92        "make_header_test.py",
93    ],
94    test_suites: ["general-tests"],
95}
96