blob: 1ced4a558e803433d45687fab022f05587f82288 [file] [log] [blame]
Ari Hausman-Cohen73442152016-06-08 15:50:49 -07001#
2# Copyright 2016 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
17LOCAL_PATH := $(call my-dir)
Ari Hausman-Cohenc17fd092016-07-18 10:13:26 -070018
19# Prevent the HAL from building on devices not specifically
20# requesting to use it.
21ifeq ($(USE_CAMERA_V4L2_HAL), true)
22
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070023v4l2_shared_libs := \
24 libbase \
25 libcamera_client \
26 libcamera_metadata \
27 libcutils \
28 libhardware \
29 liblog \
30 libnativehelper \
31 libsync \
32 libutils \
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070033
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070034v4l2_static_libs :=
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070035
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070036v4l2_cflags := -fno-short-enums -Wall -Wextra -fvisibility=hidden
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070037
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070038v4l2_c_includes := $(call include-path-for, camera)
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070039
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070040v4l2_src_files := \
Ari Hausman-Cohen3841a7f2016-07-19 17:27:52 -070041 camera.cpp \
42 stream.cpp \
43 stream_format.cpp \
44 v4l2_camera.cpp \
45 v4l2_camera_hal.cpp \
46 v4l2_gralloc.cpp \
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070047 v4l2_metadata.cpp \
Ari Hausman-Cohen3841a7f2016-07-19 17:27:52 -070048 v4l2_wrapper.cpp \
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070049
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070050v4l2_test_files := \
51 v4l2_metadata_test.cpp \
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070052
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070053# V4L2 Camera HAL.
54# ==============================================================================
55include $(CLEAR_VARS)
56LOCAL_MODULE := camera.v4l2
57LOCAL_MODULE_RELATIVE_PATH := hw
58LOCAL_CFLAGS += $(v4l2_cflags)
59LOCAL_SHARED_LIBRARIES := $(v4l2_shared_libs)
60LOCAL_STATIC_LIBRARIES := $(v4l2_static_libs)
61LOCAL_C_INCLUDES += $(v4l2_c_includes)
62LOCAL_SRC_FILES := $(v4l2_src_files)
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070063include $(BUILD_SHARED_LIBRARY)
Ari Hausman-Cohenc17fd092016-07-18 10:13:26 -070064
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070065# Unit tests for V4L2 Camera HAL.
66# ==============================================================================
67include $(CLEAR_VARS)
68LOCAL_MODULE := camera.v4l2_test
69LOCAL_CFLAGS += $(v4l2_cflags)
70LOCAL_SHARED_LIBRARIES := $(v4l2_shared_libs)
71LOCAL_STATIC_LIBRARIES := \
72 libBionicGtestMain \
73 libgmock \
74 $(v4l2_static_libs) \
75
76LOCAL_C_INCLUDES += $(v4l2_c_includes)
77LOCAL_SRC_FILES := \
78 $(v4l2_src_files) \
79 $(v4l2_test_files) \
80
81include $(BUILD_NATIVE_TEST)
82
Ari Hausman-Cohenc17fd092016-07-18 10:13:26 -070083endif # USE_CAMERA_V4L2_HAL