blob: 6e8cd339c8991e36285268beb7ae21551331fae6 [file] [log] [blame]
Colin Crossfe6064a2016-08-30 13:49:26 -07001//
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
David Srbecky0adf4d82018-10-01 18:17:45 +010017// This produces human-readable asm_defines.s with the embedded compile-time constants.
Bob Badour9150de62021-02-26 03:22:24 -080018package {
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
David Srbecky0adf4d82018-10-01 18:17:45 +010027cc_object {
28 name: "asm_defines.s",
Colin Crossfe6064a2016-08-30 13:49:26 -070029 host_supported: true,
David Srbecky0adf4d82018-10-01 18:17:45 +010030 device_supported: true,
Martin Stjernholm9dca9192021-10-28 03:01:13 +010031 defaults: ["art_debug_defaults"],
Paul Duffineafeeb22019-07-19 10:22:32 +010032 header_libs: [
33 "art_libartbase_headers", // For base/bit_utils.h
Orion Hodson00cb81d2020-04-03 06:47:07 +010034 "jni_headers",
Martin Stjernholmdc7f1392021-11-03 18:05:33 +000035 "libart_headers",
Paul Duffineafeeb22019-07-19 10:22:32 +010036 "libdexfile_all_headers", // For dex/modifiers.h
David Sehr334b9d72018-02-12 18:27:56 -080037 ],
David Srbecky0adf4d82018-10-01 18:17:45 +010038 // Produce text file rather than binary.
39 cflags: ["-S"],
40 srcs: ["asm_defines.cc"],
Jiyong Park7c2f69e2020-01-15 15:43:32 +090041 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010042 "com.android.art",
Jiyong Park7c2f69e2020-01-15 15:43:32 +090043 "com.android.art.debug",
Jiyong Park7c2f69e2020-01-15 15:43:32 +090044 ],
Colin Crossfe6064a2016-08-30 13:49:26 -070045}
Igor Murashkin2bb70d32017-02-06 10:34:14 -080046
Martin Stjernholm1dc77ab2021-05-10 17:44:05 +010047soong_config_module_type_import {
48 from: "art/build/SoongConfig.bp",
49 module_types: [
50 "art_module_cc_genrule",
51 ],
52}
53
David Srbecky0adf4d82018-10-01 18:17:45 +010054// This extracts the compile-time constants from asm_defines.s and creates the header.
Martin Stjernholm1dc77ab2021-05-10 17:44:05 +010055art_module_cc_genrule {
Dan Willemsen2ca27802017-09-27 14:57:43 -070056 name: "cpp-define-generator-asm-support",
Martin Stjernholm1dc77ab2021-05-10 17:44:05 +010057
58 // :asm_defines.s is only available when building ART from source, so do the
59 // same here.
60 // TODO(b/172480617): Clean up when sources are gone from the platform tree
61 // and we no longer need to support sources present when prebuilts are used.
62 enabled: false,
63 soong_config_variables: {
64 source_build: {
65 enabled: true,
66 },
67 },
68
David Srbecky0adf4d82018-10-01 18:17:45 +010069 host_supported: true,
70 device_supported: true,
71 srcs: [":asm_defines.s"],
David Srbecky766e74f2018-10-02 17:12:24 +010072 out: ["asm_defines.h"],
David Srbecky0adf4d82018-10-01 18:17:45 +010073 tool_files: ["make_header.py"],
74 cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"",
Elliott Hughes221dfa62019-09-03 16:03:56 -070075 target: {
76 darwin: {
77 enabled: false,
78 },
Martin Stjernholm1dc77ab2021-05-10 17:44:05 +010079 windows: {
80 // When the module is enabled globally in the soong_config_variables
81 // stanza above, it gets enabled on windows too. Hence we need to
82 // disable it explicitly.
83 // TODO(b/172480617): Clean up with that.
84 enabled: false,
85 },
Elliott Hughes221dfa62019-09-03 16:03:56 -070086 },
Jiyong Park71f661c2020-04-28 18:20:43 +090087
88 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010089 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +090090 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +090091 ],
David Srbecky0adf4d82018-10-01 18:17:45 +010092}
93
94cc_library_headers {
95 name: "cpp-define-generator-definitions",
Martin Stjernholme10abe72021-10-28 03:49:55 +010096 defaults: ["art_defaults"],
David Srbecky0adf4d82018-10-01 18:17:45 +010097 host_supported: true,
98 export_include_dirs: ["."],
Jiyong Park71f661c2020-04-28 18:20:43 +090099
100 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100101 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900102 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +0900103 ],
David Srbecky0adf4d82018-10-01 18:17:45 +0100104}
105
106python_binary_host {
107 name: "cpp-define-generator-test",
108 main: "make_header_test.py",
109 srcs: [
110 "make_header.py",
111 "make_header_test.py",
112 ],
113 test_suites: ["general-tests"],
Igor Murashkin2bb70d32017-02-06 10:34:14 -0800114}