diff --git a/engine/src/flutter/Android.bp b/engine/src/flutter/Android.bp new file mode 100644 index 0000000000..26d5027683 --- /dev/null +++ b/engine/src/flutter/Android.bp @@ -0,0 +1,10 @@ +cc_library_headers { + name: "libminikin_headers", + host_supported: true, + export_include_dirs: ["include"], +} + +subdirs = [ + "app", + "libs/minikin", +] diff --git a/engine/src/flutter/app/Android.bp b/engine/src/flutter/app/Android.bp new file mode 100644 index 0000000000..e8085c1f3e --- /dev/null +++ b/engine/src/flutter/app/Android.bp @@ -0,0 +1,30 @@ +// Copyright (C) 2015 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. + +// see how_to_run.txt for instructions on running these tests + +cc_binary_host { + name: "hyphtool", + + static_libs: ["libminikin"], + + // Shared libraries which are dependencies of minikin; these are not automatically + // pulled in by the build system (and thus sadly must be repeated). + shared_libs: [ + "liblog", + "libicuuc", + ], + + srcs: ["HyphTool.cpp"], +} diff --git a/engine/src/flutter/app/Android.mk b/engine/src/flutter/app/Android.mk deleted file mode 100644 index 23305b7b4c..0000000000 --- a/engine/src/flutter/app/Android.mk +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2015 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. - -# see how_to_run.txt for instructions on running these tests - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := hyphtool -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libminikin_host - -# Shared libraries which are dependencies of minikin; these are not automatically -# pulled in by the build system (and thus sadly must be repeated). - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libicuuc - -LOCAL_SRC_FILES += \ - HyphTool.cpp - -include $(BUILD_HOST_EXECUTABLE) diff --git a/engine/src/flutter/libs/minikin/Android.bp b/engine/src/flutter/libs/minikin/Android.bp new file mode 100644 index 0000000000..ef721ea80b --- /dev/null +++ b/engine/src/flutter/libs/minikin/Android.bp @@ -0,0 +1,78 @@ +// Copyright (C) 2013 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. + +cc_library { + name: "libminikin", + host_supported: true, + srcs: [ + "Hyphenator.cpp", + ], + target: { + android: { + srcs: [ + "CmapCoverage.cpp", + "Emoji.cpp", + "FontCollection.cpp", + "FontFamily.cpp", + "FontLanguage.cpp", + "FontLanguageListCache.cpp", + "FontUtils.cpp", + "GraphemeBreak.cpp", + "HbFontCache.cpp", + "Layout.cpp", + "LayoutUtils.cpp", + "LineBreaker.cpp", + "Measurement.cpp", + "MinikinInternal.cpp", + "MinikinFont.cpp", + "SparseBitSet.cpp", + "WordBreaker.cpp", + ], + shared_libs: [ + "libharfbuzz_ng", + "libft2", + "libz", + "libutils", + ], + // TODO: clean up Minikin so it doesn't need the freetype include + export_shared_lib_headers: ["libft2"], + }, + }, + cppflags: [ + "-Werror", + "-Wall", + "-Wextra", + ], + product_variables: { + debuggable: { + // Enable race detection on eng and userdebug build. + cppflags: ["-DENABLE_RACE_DETECTION"], + }, + }, + shared_libs: [ + "liblog", + "libicuuc", + ], + header_libs: ["libminikin_headers"], + export_header_lib_headers: ["libminikin_headers"], + + clang: true, + sanitize: { + misc_undefined: [ + "signed-integer-overflow", + // b/26432628. + //"unsigned-integer-overflow", + ], + }, +} diff --git a/engine/src/flutter/libs/minikin/Android.mk b/engine/src/flutter/libs/minikin/Android.mk deleted file mode 100644 index bb6234a123..0000000000 --- a/engine/src/flutter/libs/minikin/Android.mk +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (C) 2013 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. - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -include $(CLEAR_VARS) -minikin_src_files := \ - CmapCoverage.cpp \ - Emoji.cpp \ - FontCollection.cpp \ - FontFamily.cpp \ - FontLanguage.cpp \ - FontLanguageListCache.cpp \ - FontUtils.cpp \ - GraphemeBreak.cpp \ - HbFontCache.cpp \ - Hyphenator.cpp \ - Layout.cpp \ - LayoutUtils.cpp \ - LineBreaker.cpp \ - Measurement.cpp \ - MinikinInternal.cpp \ - MinikinFont.cpp \ - SparseBitSet.cpp \ - WordBreaker.cpp - -minikin_c_includes := \ - external/harfbuzz_ng/src \ - frameworks/minikin/include \ - $(intermediates) - -minikin_shared_libraries := \ - libharfbuzz_ng \ - libft2 \ - liblog \ - libz \ - libicuuc \ - libutils - -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) -# Enable race detection on eng and userdebug build. -enable_race_detection := -DENABLE_RACE_DETECTION -else -enable_race_detection := -endif - -LOCAL_MODULE := libminikin -LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include -LOCAL_SRC_FILES := $(minikin_src_files) -LOCAL_C_INCLUDES := $(minikin_c_includes) -LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection) -LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries) -LOCAL_CLANG := true -LOCAL_SANITIZE := signed-integer-overflow -# b/26432628. -#LOCAL_SANITIZE += unsigned-integer-overflow - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libminikin -LOCAL_MODULE_TAGS := optional -LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include -LOCAL_SRC_FILES := $(minikin_src_files) -LOCAL_C_INCLUDES := $(minikin_c_includes) -LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection) -LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries) -LOCAL_CLANG := true -LOCAL_SANITIZE := signed-integer-overflow -# b/26432628. -#LOCAL_SANITIZE += unsigned-integer-overflow - -include $(BUILD_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -# Reduced library (currently just hyphenation) for host - -LOCAL_MODULE := libminikin_host -LOCAL_MODULE_TAGS := optional -LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include -LOCAL_C_INCLUDES := $(minikin_c_includes) -LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection) -LOCAL_SHARED_LIBRARIES := liblog libicuuc - -LOCAL_SRC_FILES := Hyphenator.cpp - -include $(BUILD_HOST_STATIC_LIBRARY)