diff options
-rw-r--r-- | circle.yml | 2 | ||||
-rw-r--r-- | cmake/icu.cmake | 26 | ||||
-rw-r--r-- | cmake/mason-dependencies.cmake | 7 | ||||
-rw-r--r-- | platform/android/config.cmake | 3 | ||||
-rw-r--r-- | platform/ios/config.cmake | 4 | ||||
-rw-r--r-- | platform/ios/ios.xcodeproj/project.pbxproj | 8 | ||||
-rw-r--r-- | platform/linux/config.cmake | 3 | ||||
-rw-r--r-- | platform/macos/config.cmake | 3 | ||||
-rw-r--r-- | platform/macos/macos.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | platform/qt/config.cmake | 6 | ||||
-rwxr-xr-x | scripts/vendor/icu.sh | 54 | ||||
-rw-r--r-- | vendor/icu/files.txt | 69 | ||||
-rw-r--r-- | vendor/icu/version.txt | 1 |
13 files changed, 177 insertions, 13 deletions
diff --git a/circle.yml b/circle.yml index a86bd24101..c03b52e12f 100644 --- a/circle.yml +++ b/circle.yml @@ -300,7 +300,7 @@ step-library: jobs: nitpick: docker: - - image: mbgl/7d2403f42e:base + - image: mbgl/7d2403f42e:linux-clang-4 working_directory: /src environment: LIBSYSCONFCPUS: 4 diff --git a/cmake/icu.cmake b/cmake/icu.cmake new file mode 100644 index 0000000000..ba98c7737a --- /dev/null +++ b/cmake/icu.cmake @@ -0,0 +1,26 @@ +add_vendor_target(icu STATIC) + +target_compile_definitions(icu + PRIVATE "-D_REENTRANT" + PRIVATE "-DU_HAVE_ATOMIC=1" + PRIVATE "-DU_HAVE_STRTOD_L=0" + PRIVATE "-DU_CHARSET_IS_UTF8=1" + PRIVATE "-DU_CHAR_TYPE=uint_least16_t" + PRIVATE "-DUCONFIG_NO_LEGACY_CONVERSION=1" + PRIVATE "-DUCONFIG_NO_BREAK_ITERATION=1" +) + +target_compile_options(icu + PRIVATE "-Wno-shadow" +) + +if(MBGL_PLATFORM STREQUAL "android") + target_compile_options(icu + PRIVATE "-Wno-tautological-unsigned-enum-zero-compare" + ) +elseif(MBGL_PLATFORM STREQUAL "ios") + target_compile_options(icu + PRIVATE "-Wno-shorten-64-to-32" + ) +endif() + diff --git a/cmake/mason-dependencies.cmake b/cmake/mason-dependencies.cmake index d2ea79b32b..4caa6d4d88 100644 --- a/cmake/mason-dependencies.cmake +++ b/cmake/mason-dependencies.cmake @@ -20,7 +20,6 @@ mason_use(vector-tile VERSION 1.0.2 HEADER_ONLY) if(MBGL_PLATFORM STREQUAL "android") mason_use(jni.hpp VERSION 3.0.0 HEADER_ONLY) - mason_use(icu VERSION 58.1-min-size) elseif(MBGL_PLATFORM STREQUAL "ios") mason_use(icu VERSION 58.1-min-size) elseif(MBGL_PLATFORM STREQUAL "linux") @@ -30,7 +29,6 @@ elseif(MBGL_PLATFORM STREQUAL "linux") mason_use(libjpeg-turbo VERSION 1.5.0) mason_use(webp VERSION 0.5.1) mason_use(benchmark VERSION 1.4.1${MASON_CXXABI_SUFFIX}) - mason_use(icu VERSION 58.1-min-size) mason_use(args VERSION 6.2.0 HEADER_ONLY) if(WITH_EGL) @@ -39,7 +37,6 @@ elseif(MBGL_PLATFORM STREQUAL "linux") elseif(MBGL_PLATFORM STREQUAL "macos") mason_use(glfw VERSION 2018-06-27-0be4f3f) mason_use(benchmark VERSION 1.4.1) - mason_use(icu VERSION 58.1-min-size) mason_use(args VERSION 6.2.0 HEADER_ONLY) if(WITH_EGL) @@ -53,8 +50,4 @@ elseif(MBGL_PLATFORM STREQUAL "qt") mason_use(libpng VERSION 1.6.25) mason_use(webp VERSION 0.5.1) endif() - - if(NOT WITH_QT_I18N) - mason_use(icu VERSION 58.1-min-size) - endif() endif() diff --git a/platform/android/config.cmake b/platform/android/config.cmake index f0c3324cc4..d6be05095b 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -2,6 +2,7 @@ set(USE_GLES2 ON) include(cmake/nunicode.cmake) include(cmake/sqlite.cmake) +include(cmake/icu.cmake) # Build thin archives. set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cruT <TARGET> <LINK_FLAGS> <OBJECTS>") @@ -46,10 +47,10 @@ macro(mbgl_platform_core) target_add_mason_package(mbgl-core PUBLIC geojson) target_add_mason_package(mbgl-core PUBLIC jni.hpp) target_add_mason_package(mbgl-core PUBLIC rapidjson) - target_add_mason_package(mbgl-core PRIVATE icu) target_link_libraries(mbgl-core PRIVATE nunicode + PRIVATE icu PUBLIC expected PUBLIC -llog PUBLIC -landroid diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake index 6bed436f64..471c1183a5 100644 --- a/platform/ios/config.cmake +++ b/platform/ios/config.cmake @@ -12,7 +12,9 @@ macro(initialize_ios_target target) endmacro() +include(cmake/icu.cmake) include(cmake/loop-darwin.cmake) +initialize_ios_target(icu) initialize_ios_target(mbgl-loop-darwin) @@ -61,7 +63,6 @@ macro(mbgl_platform_core) target_add_mason_package(mbgl-core PUBLIC geojson) target_add_mason_package(mbgl-core PUBLIC polylabel) - target_add_mason_package(mbgl-core PRIVATE icu) target_include_directories(mbgl-core PUBLIC platform/darwin @@ -69,6 +70,7 @@ macro(mbgl_platform_core) ) target_link_libraries(mbgl-core + PRIVATE icu PUBLIC "-lz" PUBLIC "-framework Foundation" PUBLIC "-framework CoreText" diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index c77f1baf6c..ca84ff295d 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -285,6 +285,8 @@ 558DE7A11E5615E400C7916D /* MGLFoundation_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 558DE79E1E5615E400C7916D /* MGLFoundation_Private.h */; }; 558DE7A21E5615E400C7916D /* MGLFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558DE79F1E5615E400C7916D /* MGLFoundation.mm */; }; 558DE7A31E5615E400C7916D /* MGLFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558DE79F1E5615E400C7916D /* MGLFoundation.mm */; }; + 55CF752F213ED92000ED86C4 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF752E213ED92000ED86C4 /* libicu.a */; }; + 55CF7531213ED92A00ED86C4 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF7530213ED92A00ED86C4 /* libicu.a */; }; 55D120A61F791007004B6D81 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A71F791007004B6D81 /* libmbgl-loop-darwin.a */; }; 55D120A81F79100C004B6D81 /* libmbgl-filesource.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A91F79100C004B6D81 /* libmbgl-filesource.a */; }; 55E2AD131E5B125400E8C587 /* MGLOfflineStorageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55E2AD121E5B125400E8C587 /* MGLOfflineStorageTests.mm */; }; @@ -972,6 +974,8 @@ 556660D71E1D085500E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = "<group>"; }; 558DE79E1E5615E400C7916D /* MGLFoundation_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFoundation_Private.h; sourceTree = "<group>"; }; 558DE79F1E5615E400C7916D /* MGLFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFoundation.mm; sourceTree = "<group>"; }; + 55CF752E213ED92000ED86C4 /* libicu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libicu.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 55CF7530213ED92A00ED86C4 /* libicu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libicu.a; sourceTree = BUILT_PRODUCTS_DIR; }; 55D120A71F791007004B6D81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-loop-darwin.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 55D120A91F79100C004B6D81 /* libmbgl-filesource.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-filesource.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 55D8C9941D0F133500F42F10 /* config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = config.xcconfig; path = ../../build/ios/config.xcconfig; sourceTree = "<group>"; }; @@ -1357,6 +1361,7 @@ DAABF73D1CBC59BB005B1825 /* libmbgl-core.a in Frameworks */, 55D120A61F791007004B6D81 /* libmbgl-loop-darwin.a in Frameworks */, 55D120A81F79100C004B6D81 /* libmbgl-filesource.a in Frameworks */, + 55CF752F213ED92000ED86C4 /* libicu.a in Frameworks */, DA27C24E1CBB3811000B0ECD /* GLKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1368,6 +1373,7 @@ DAAE5F8720F046E60089D85B /* libmbgl-core.a in Frameworks */, DAAE5F8920F047240089D85B /* libmbgl-filesource.a in Frameworks */, DAAE5F8A20F0472E0089D85B /* libmbgl-loop-darwin.a in Frameworks */, + 55CF7531213ED92A00ED86C4 /* libicu.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1839,6 +1845,8 @@ DA1DC9921CB6DF24006E619F /* Frameworks */ = { isa = PBXGroup; children = ( + 55CF7530213ED92A00ED86C4 /* libicu.a */, + 55CF752E213ED92000ED86C4 /* libicu.a */, 55D120A91F79100C004B6D81 /* libmbgl-filesource.a */, 55D120A71F791007004B6D81 /* libmbgl-loop-darwin.a */, 36F1153C1D46080700878E1A /* libmbgl-platform-ios.a */, diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake index 86280b7068..be2b1cd9d9 100644 --- a/platform/linux/config.cmake +++ b/platform/linux/config.cmake @@ -1,5 +1,6 @@ include(cmake/nunicode.cmake) include(cmake/sqlite.cmake) +include(cmake/icu.cmake) add_library(mbgl-loop-uv STATIC platform/default/async_task.cpp @@ -81,11 +82,11 @@ macro(mbgl_platform_core) target_add_mason_package(mbgl-core PUBLIC libpng) target_add_mason_package(mbgl-core PUBLIC libjpeg-turbo) target_add_mason_package(mbgl-core PUBLIC webp) - target_add_mason_package(mbgl-core PRIVATE icu) target_add_mason_package(mbgl-core PUBLIC geojson) target_link_libraries(mbgl-core PRIVATE nunicode + PRIVATE icu PUBLIC -lz ) diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index f164b8491e..1fb09e066e 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -1,5 +1,6 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11) +include(cmake/icu.cmake) include(cmake/loop-darwin.cmake) macro(mbgl_platform_core) @@ -55,7 +56,6 @@ macro(mbgl_platform_core) target_add_mason_package(mbgl-core PUBLIC geojson) target_add_mason_package(mbgl-core PUBLIC polylabel) - target_add_mason_package(mbgl-core PRIVATE icu) target_compile_options(mbgl-core PRIVATE -fobjc-arc @@ -67,6 +67,7 @@ macro(mbgl_platform_core) ) target_link_libraries(mbgl-core + PRIVATE icu PUBLIC "-lz" PUBLIC "-framework Foundation" PUBLIC "-framework CoreText" diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 7ee83bf483..040bd785d5 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -85,6 +85,7 @@ 556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */; }; 558DE7A61E56161C00C7916D /* MGLFoundation_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */; }; 558DE7A71E56161C00C7916D /* MGLFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558DE7A51E56161C00C7916D /* MGLFoundation.mm */; }; + 55CF7533213EDADF00ED86C4 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF7532213EDADF00ED86C4 /* libicu.a */; }; 55D120A31F7906E6004B6D81 /* libmbgl-filesource.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */; }; 55D120A51F790A0C004B6D81 /* libmbgl-filesource.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */; }; 55E2AD111E5B0A6900E8C587 /* MGLOfflineStorageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */; }; @@ -378,6 +379,7 @@ 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = "<group>"; }; 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFoundation_Private.h; sourceTree = "<group>"; }; 558DE7A51E56161C00C7916D /* MGLFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFoundation.mm; sourceTree = "<group>"; }; + 55CF7532213EDADF00ED86C4 /* libicu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libicu.a; sourceTree = BUILT_PRODUCTS_DIR; }; 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-filesource.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 55D9B4B01D005D3900C1CCE2 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLOfflineStorageTests.mm; path = ../../darwin/test/MGLOfflineStorageTests.mm; sourceTree = "<group>"; }; @@ -672,6 +674,7 @@ 5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */, 55D120A31F7906E6004B6D81 /* libmbgl-filesource.a in Frameworks */, 52B5D17F1E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */, + 55CF7533213EDADF00ED86C4 /* libicu.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1064,6 +1067,7 @@ DAE6C31E1CC308BC00DB3429 /* Frameworks */ = { isa = PBXGroup; children = ( + 55CF7532213EDADF00ED86C4 /* libicu.a */, 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */, 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */, 55D9B4B01D005D3900C1CCE2 /* libz.tbd */, diff --git a/platform/qt/config.cmake b/platform/qt/config.cmake index 5cb622f813..5f639b3f78 100644 --- a/platform/qt/config.cmake +++ b/platform/qt/config.cmake @@ -1,6 +1,10 @@ include(platform/qt/qt.cmake) include(cmake/nunicode.cmake) +if(NOT WITH_QT_I18N) + include(cmake/icu.cmake) +endif() + macro(mbgl_platform_core) target_sources(mbgl-core ${MBGL_QT_CORE_FILES} @@ -33,7 +37,7 @@ macro(mbgl_platform_core) if(NOT WITH_QT_I18N) target_sources(mbgl-core PRIVATE platform/default/bidi.cpp) - target_add_mason_package(mbgl-core PRIVATE icu) + target_link_libraries(mbgl-core PRIVATE icu) else() target_sources(mbgl-core PRIVATE platform/qt/src/bidi.cpp) endif() diff --git a/scripts/vendor/icu.sh b/scripts/vendor/icu.sh new file mode 100755 index 0000000000..8ee9cd76fb --- /dev/null +++ b/scripts/vendor/icu.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +source "$(dirname "${BASH_SOURCE[0]}")/common.sh" + +NAME=icu +VERSION=61.1 +ROOT=icu/source + +download "http://download.icu-project.org/files/icu4c/$VERSION/icu4c-${VERSION//./_}-src.tgz" +init +STRIP_COMPONENTS=2 extract_gzip "${ROOT}/common/*.h" "${ROOT}/common/*.cpp" +STRIP_COMPONENTS=1 extract_gzip "icu/LICENSE" + +# List all files we want to extract +FILES=( + ushape.cpp + ubidi.cpp + ubidi_props.cpp + ubidiln.cpp + ubidiwrt.cpp + ustring.cpp + uinvchar.cpp + uchar.cpp + udataswp.cpp + umath.cpp + utrie2.cpp + utf_impl.cpp + utypes.cpp + cmemory.cpp + cstring.cpp +) + +# Find dependencies for all of these files +echo ">> Finding dependencies..." +ALL=() +for FILE in "${FILES[@]}"; do + ALL+=($(cd "common" && $CXX -std=c++14 -I. -c "$FILE" -M | sed -e 's/^[a-z0-9._-]*: *//;s/ *\\$//')) +done + +# Remove duplicates +IFS=$'\n' ALL=($(sort <<< "${ALL[*]}" | uniq | sed '/^\//d')) +unset IFS + +echo ">> Copying files..." +mkdir -p src include/unicode +for FILE in "${ALL[@]}"; do + [[ "$FILE" = unicode/* ]] && DIR="include" || DIR="src" + # Copy file and replace #include "unicode/*" with #include <unicode/*> so that we can separate + # includes and source-only files. + sed 's/^#include \"\(unicode\/[^\"]\{1,\}\)\"/#include <\1>/' "common/$FILE" > "$DIR/$FILE" +done + +rm -rf common + +file_list include src -name "*.h" -o -name "*.cpp" diff --git a/vendor/icu/files.txt b/vendor/icu/files.txt new file mode 100644 index 0000000000..9d5af07f87 --- /dev/null +++ b/vendor/icu/files.txt @@ -0,0 +1,69 @@ +include/unicode/bytestream.h +include/unicode/char16ptr.h +include/unicode/localpointer.h +include/unicode/platform.h +include/unicode/ptypes.h +include/unicode/putil.h +include/unicode/rep.h +include/unicode/std_string.h +include/unicode/stringoptions.h +include/unicode/stringpiece.h +include/unicode/ubidi.h +include/unicode/uchar.h +include/unicode/uclean.h +include/unicode/uconfig.h +include/unicode/udata.h +include/unicode/uiter.h +include/unicode/umachine.h +include/unicode/unistr.h +include/unicode/uobject.h +include/unicode/urename.h +include/unicode/uscript.h +include/unicode/uset.h +include/unicode/ushape.h +include/unicode/ustring.h +include/unicode/utf.h +include/unicode/utf16.h +include/unicode/utf8.h +include/unicode/utf_old.h +include/unicode/utypes.h +include/unicode/uvernum.h +include/unicode/uversion.h +src/cmemory.cpp +src/cmemory.h +src/cstring.cpp +src/cstring.h +src/cwchar.h +src/mutex.h +src/putilimp.h +src/uassert.h +src/ubidi.cpp +src/ubidi_props.cpp +src/ubidi_props.h +src/ubidi_props_data.h +src/ubidiimp.h +src/ubidiln.cpp +src/ubidiwrt.cpp +src/uchar.cpp +src/uchar_props_data.h +src/ucln.h +src/ucln_cmn.h +src/ucmndata.h +src/udatamem.h +src/udataswp.cpp +src/udataswp.h +src/uinvchar.cpp +src/uinvchar.h +src/umapfile.h +src/umath.cpp +src/umutex.h +src/uprops.h +src/uset_imp.h +src/ushape.cpp +src/ustr_imp.h +src/ustring.cpp +src/utf_impl.cpp +src/utrie2.cpp +src/utrie2.h +src/utrie2_impl.h +src/utypes.cpp diff --git a/vendor/icu/version.txt b/vendor/icu/version.txt new file mode 100644 index 0000000000..721381cdd7 --- /dev/null +++ b/vendor/icu/version.txt @@ -0,0 +1 @@ +61.1 |