| // |
| // Copyright (C) 2022-2024 The LeafOS Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| |
| bootstrap_go_package { |
| name: "soong-leaf-generator", |
| pkgPath: "leaf/soong/generator", |
| deps: [ |
| "blueprint", |
| "blueprint-pathtools", |
| "soong", |
| "soong-android", |
| "soong-shared", |
| ], |
| srcs: [ |
| "generator/generator.go", |
| "generator/variables.go", |
| ], |
| pluginFor: ["soong_build"], |
| } |
| |
| leaf_generator { |
| name: "generated_kernel_includes", |
| |
| // The headers make command |
| cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(KERNEL_BUILD_OUT_PREFIX)$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install && vendor/leaf/tools/clean_headers.sh $(KERNEL_BUILD_OUT_PREFIX)$(genDir)", |
| |
| // Directories that can be imported by a cc_* module generated_headers property |
| export_include_dirs: [ |
| "usr/audio/include/uapi", |
| "usr/include", |
| "usr/include/audio", |
| "usr/include/audio/include/uapi", |
| "usr/techpack/audio/include", |
| ], |
| |
| // Sources for dependency tracking |
| dep_root: "$(TARGET_KERNEL_SOURCE)", |
| dep_files: [ |
| "Makefile", |
| "include/**/*", |
| "arch/$(KERNEL_ARCH)/include/**/*", |
| "techpack/audio/include/**/*", |
| ], |
| } |
| |
| cc_library_headers { |
| name: "generated_kernel_headers", |
| generated_headers: ["generated_kernel_includes"], |
| export_generated_headers: ["generated_kernel_includes"], |
| vendor_available: true, |
| recovery_available: true, |
| } |
| |
| soong_config_module_type { |
| name: "aapt_version_code", |
| module_type: "java_defaults", |
| config_namespace: "leafGlobalVars", |
| value_variables: ["aapt_version_code"], |
| properties: ["aaptflags"], |
| } |
| |
| aapt_version_code { |
| name: "aapt_version_code_defaults", |
| soong_config_variables: { |
| aapt_version_code: { |
| aaptflags: [ |
| "--version-code", |
| "%s", |
| ], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "vendor_init", |
| module_type: "cc_defaults", |
| config_namespace: "leafGlobalVars", |
| value_variables: ["target_init_vendor_lib"], |
| properties: ["whole_static_libs"], |
| } |
| |
| vendor_init { |
| name: "vendor_init_defaults", |
| soong_config_variables: { |
| target_init_vendor_lib: { |
| whole_static_libs: ["%s"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "health_charging_control", |
| module_type: "cc_defaults", |
| config_namespace: "leafGlobalVars", |
| bool_variables: [ |
| "target_health_charging_control_supports_toggle", |
| "target_health_charging_control_supports_bypass", |
| "target_health_charging_control_supports_deadline", |
| ], |
| value_variables: [ |
| "target_health_charging_control_charging_path", |
| "target_health_charging_control_charging_enabled", |
| "target_health_charging_control_charging_disabled", |
| "target_health_charging_control_deadline_path", |
| ], |
| properties: ["cppflags"], |
| } |
| |
| health_charging_control { |
| name: "health_charging_control_defaults", |
| soong_config_variables: { |
| target_health_charging_control_supports_toggle: { |
| cppflags: ["-DHEALTH_CHARGING_CONTROL_SUPPORTS_TOGGLE"], |
| }, |
| target_health_charging_control_supports_bypass: { |
| cppflags: ["-DHEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS"], |
| }, |
| target_health_charging_control_supports_deadline: { |
| cppflags: ["-DHEALTH_CHARGING_CONTROL_SUPPORTS_DEADLINE"], |
| }, |
| target_health_charging_control_charging_path: { |
| cppflags: ["-DHEALTH_CHARGING_CONTROL_CHARGING_PATH=\"%s\""], |
| }, |
| target_health_charging_control_charging_enabled: { |
| cppflags: ["-DHEALTH_CHARGING_CONTROL_CHARGING_ENABLED=\"%s\""], |
| }, |
| target_health_charging_control_charging_disabled: { |
| cppflags: ["-DHEALTH_CHARGING_CONTROL_CHARGING_DISABLED=\"%s\""], |
| }, |
| target_health_charging_control_deadline_path: { |
| cppflags: ["-DHEALTH_CHARGING_CONTROL_DEADLINE_PATH=\"%s\""], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "bootloader_message_offset", |
| module_type: "cc_defaults", |
| config_namespace: "leafGlobalVars", |
| value_variables: ["bootloader_message_offset"], |
| properties: [ |
| "cflags", |
| "export_cflags", |
| ], |
| } |
| |
| bootloader_message_offset { |
| name: "bootloader_message_offset_defaults", |
| soong_config_variables: { |
| bootloader_message_offset: { |
| cflags: ["-DBOARD_RECOVERY_BLDRMSG_OFFSET=%s"], |
| export_cflags: ["-DBOARD_RECOVERY_BLDRMSG_OFFSET=%s"], |
| }, |
| }, |
| } |
| |
| // QCOM specific config modules |
| soong_config_module_type { |
| name: "librmnetctl_pre_uplink", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| bool_variables: ["uses_pre_uplink_features_netmgrd"], |
| properties: ["cflags"], |
| } |
| |
| librmnetctl_pre_uplink { |
| name: "librmnetctl_pre_uplink_defaults", |
| soong_config_variables: { |
| uses_pre_uplink_features_netmgrd: { |
| cflags: ["-DNO_UPLINK_FEATURES"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "extended_compress_format", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| bool_variables: ["supports_extended_compress_format"], |
| properties: ["cflags"], |
| } |
| |
| extended_compress_format { |
| name: "extended_compress_format_defaults", |
| soong_config_variables: { |
| supports_extended_compress_format: { |
| cflags: ["-DENABLE_EXTENDED_COMPRESS_FORMAT"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "surfaceflinger_qcom_extensions", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| value_variables: ["qcom_display_headers_namespace"], |
| properties: [ |
| "cppflags", |
| "header_libs", |
| ], |
| } |
| |
| surfaceflinger_qcom_extensions { |
| name: "surfaceflinger_qcom_ext_defaults", |
| soong_config_variables: { |
| qcom_display_headers_namespace: { |
| cppflags: ["-DQCOM_UM_FAMILY"], |
| header_libs: ["//%s:display_intf_headers"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "gralloc_handle_custom_content_md_reserved_size", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| bool_variables: ["gralloc_handle_has_custom_content_md_reserved_size"], |
| properties: ["export_cflags"], |
| } |
| |
| gralloc_handle_custom_content_md_reserved_size { |
| name: "gralloc_handle_has_custom_content_md_reserved_size_defaults", |
| soong_config_variables: { |
| gralloc_handle_has_custom_content_md_reserved_size: { |
| export_cflags: ["-DGRALLOC_HANDLE_HAS_CUSTOM_CONTENT_MD_RESERVED_SIZE"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "gralloc_handle_reserved_size", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| bool_variables: ["gralloc_handle_has_reserved_size"], |
| properties: ["export_cflags"], |
| } |
| |
| gralloc_handle_reserved_size { |
| name: "gralloc_handle_has_reserved_size_defaults", |
| soong_config_variables: { |
| gralloc_handle_has_reserved_size: { |
| export_cflags: ["-DGRALLOC_HANDLE_HAS_RESERVED_SIZE"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "gralloc_handle_ubwcp_format", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| bool_variables: ["gralloc_handle_has_ubwcp_format"], |
| properties: ["export_cflags"], |
| } |
| |
| gralloc_handle_ubwcp_format { |
| name: "gralloc_handle_has_ubwcp_format_defaults", |
| soong_config_variables: { |
| gralloc_handle_has_ubwcp_format: { |
| export_cflags: ["-DGRALLOC_HANDLE_HAS_UBWCP_FORMAT"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "qti_vibrator_hal", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| bool_variables: ["qti_vibrator_use_effect_stream"], |
| value_variables: ["qti_vibrator_effect_lib"], |
| properties: [ |
| "cppflags", |
| "shared_libs", |
| ], |
| } |
| |
| qti_vibrator_hal { |
| name: "qti_vibrator_hal_defaults", |
| soong_config_variables: { |
| qti_vibrator_use_effect_stream: { |
| cppflags: ["-DUSE_EFFECT_STREAM"], |
| }, |
| qti_vibrator_effect_lib: { |
| shared_libs: ["%s"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "sdmcore_has_is_display_hw_available", |
| module_type: "cc_defaults", |
| config_namespace: "leafQcomVars", |
| bool_variables: ["sdmcore_has_is_display_hw_available_func"], |
| properties: ["cflags"], |
| } |
| |
| sdmcore_has_is_display_hw_available { |
| name: "sdmcore_has_is_display_hw_available_func_defaults", |
| soong_config_variables: { |
| sdmcore_has_is_display_hw_available_func: { |
| cflags: ["-DSDMCORE_HAS_IS_DISPLAY_HW_AVAILABLE_FUNC"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "power_libperfmgr", |
| module_type: "cc_defaults", |
| config_namespace: "leafGlobalVars", |
| value_variables: ["target_power_libperfmgr_mode_extension_lib"], |
| properties: [ |
| "whole_static_libs", |
| ], |
| } |
| |
| power_libperfmgr { |
| name: "power_libperfmgr_defaults", |
| soong_config_variables: { |
| target_power_libperfmgr_mode_extension_lib: { |
| whole_static_libs: ["%s"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "surfaceflinger_udfps_lib", |
| module_type: "cc_defaults", |
| config_namespace: "leafGlobalVars", |
| value_variables: ["target_surfaceflinger_udfps_lib"], |
| properties: [ |
| "cppflags", |
| "whole_static_libs", |
| ], |
| } |
| |
| surfaceflinger_udfps_lib { |
| name: "surfaceflinger_udfps_lib_defaults", |
| soong_config_variables: { |
| target_surfaceflinger_udfps_lib: { |
| cppflags: ["-DTARGET_PROVIDES_UDFPS_LIB"], |
| whole_static_libs: ["%s"], |
| }, |
| }, |
| } |
| |
| soong_config_module_type { |
| name: "trust_usb_control", |
| module_type: "cc_defaults", |
| config_namespace: "leafGlobalVars", |
| value_variables: [ |
| "target_trust_usb_control_path", |
| "target_trust_usb_control_enable", |
| "target_trust_usb_control_disable", |
| ], |
| properties: ["cppflags"], |
| } |
| |
| trust_usb_control { |
| name: "trust_usb_control_defaults", |
| soong_config_variables: { |
| target_trust_usb_control_path: { |
| cppflags: ["-DUSB_CONTROL_PATH=\"%s\""], |
| }, |
| target_trust_usb_control_enable: { |
| cppflags: ["-DUSB_CONTROL_ENABLE=\"%s\""], |
| }, |
| target_trust_usb_control_disable: { |
| cppflags: ["-DUSB_CONTROL_DISABLE=\"%s\""], |
| }, |
| }, |
| } |