Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdbcb7e3 authored by Jan Sebechlebsky's avatar Jan Sebechlebsky
Browse files

Create static library for querying virtual camera build flag value.

Bug: 318088136
Bug: 301023410
Test: build
Change-Id: I4006b2767b68d556a1dc2c266f84cfd464b95699
parent 3634b6e6
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
soong_config_module_type {
    name: "virtual_device_build_flags_cc_defaults",
    module_type: "cc_defaults",
    config_namespace: "vdm",
    bool_variables: [
        "virtual_camera_service_enabled",
    ],
    properties: [
        "cflags",
    ],
}

soong_config_bool_variable {
    name: "virtual_camera_service_enabled",
}

virtual_device_build_flags_cc_defaults {
    name: "virtual_device_build_flags_defaults",
    soong_config_variables: {
        virtual_camera_service_enabled: {
            cflags: ["-DVIRTUAL_CAMERA_SERVICE_ENABLED=1"],
        },
    },
}

cc_library_static {
    name: "libvirtualdevicebuildflags",
    srcs: [
        "android_companion_virtualdevice_build_flags.cc",
    ],
    export_include_dirs: ["."],
    defaults: ["virtual_device_build_flags_defaults"],
}
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 The Android Open Source 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.
 */

namespace android {
namespace companion {
namespace virtualdevice {
namespace flags {

bool virtual_camera_service_build_flag() {
#if VIRTUAL_CAMERA_SERVICE_ENABLED
  return true;
#else
  return false;
#endif
}

}  // namespace flags
}  // namespace virtualdevice
}  // namespace companion
}  // namespace android
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 The Android Open Source 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.
 */

namespace android {
namespace companion {
namespace virtualdevice {
namespace flags {

// Returns true if the virtual camera service is enabled
// in the build.
//
// TODO(b/309090563) - Deprecate in favor of autogened library to query build
// flags once available.
bool virtual_camera_service_build_flag();

}  // namespace flags
}  // namespace virtualdevice
}  // namespace companion
}  // namespace android