Peter abe556d927 Add 'submodules/webp/' from commit '4476fa2f8d85c9767ddd750918c4d97f1ee0d0e0'
git-subtree-dir: submodules/webp
git-subtree-mainline: b317aab56885d50bcbc1e44f395ed0eeb3c1ce20
git-subtree-split: 4476fa2f8d85c9767ddd750918c4d97f1ee0d0e0
2019-06-11 19:01:36 +01:00

56 lines
1.4 KiB
Python

load('//tools:buck_utils.bzl', 'config_with_updated_linker_flags', 'configs_with_config', 'glob_sub_map', 'combined_config')
load('//tools:buck_defs.bzl', 'SHARED_CONFIGS', 'EXTENSION_LIB_SPECIFIC_CONFIG')
genrule(
name = 'webp_lib_file',
srcs = [
'lib/libwebp.a',
],
bash = 'mkdir -p $OUT; cp $SRCS $OUT/',
out = 'webp_lib_file',
visibility = [
'//submodules/webp:...',
]
)
apple_library(
name = 'webp_lib',
visibility = [
'//submodules/webp:...'
],
header_namespace = 'webp',
exported_headers = glob_sub_map('include/', glob([
'include/**/*.h',
])),
exported_linker_flags = [
'-lwebp',
'-L$(location :webp_lib_file)',
],
)
apple_library(
name = 'WebPImage',
srcs = glob([
'WebP/*.m',
]),
headers = glob([
'WebP/*.h',
], exclude = ['WebP/WebP.h']),
header_namespace = 'WebPImage',
exported_headers = glob([
'WebP/*.h',
], exclude = ['WebP/WebP.h']),
modular = True,
configs = configs_with_config(combined_config([SHARED_CONFIGS, EXTENSION_LIB_SPECIFIC_CONFIG])),
compiler_flags = ['-w'],
preprocessor_flags = ['-fobjc-arc'],
visibility = ['PUBLIC'],
deps = [
':webp_lib',
],
frameworks = [
'$SDKROOT/System/Library/Frameworks/Foundation.framework',
'$SDKROOT/System/Library/Frameworks/UIKit.framework',
],
)