android: Define OS_CHROMEOS macro if android_platform=cros

Android Camera HAL 3 API used in ChromeOS has a ChromeOS own
extension, for example, crop_rotate_scale_degrees in
camera3_stream. As those extensions are not available on Android
platforms, introduce a OS_CHROMEOS macro that can be used to
compile CrOS-specific code conditionally. The macro is defined
if and only if android_platform is 'cros'.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Hirokazu Honda 2021-04-03 22:10:12 +09:00 committed by Laurent Pinchart
parent cc0dc7f611
commit 185574b741
3 changed files with 6 additions and 0 deletions

View file

@ -35,6 +35,10 @@ endif
android_deps += [libyuv_dep]
if get_option('android_platform') == 'cros'
libcamera_cpp_args += [ '-DOS_CHROMEOS']
endif
subdir('cros')
android_hal_sources = files([

View file

@ -148,6 +148,7 @@ libcamera = shared_library('camera',
libcamera_sources,
install : true,
link_with : libcamera_link_with,
cpp_args : libcamera_cpp_args,
include_directories : includes,
objects : libcamera_objects,
build_rpath : '/',

View file

@ -11,6 +11,7 @@ else
ipa_sign_module = false
endif
libcamera_cpp_args = []
libcamera_objects = []
# The 'android' subdir must be processed first, and the build targets