From 69960afb8db0444ec11cb46b47e877cc34f61fc7 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Wed, 24 Oct 2018 01:53:22 +0300 Subject: [build] Add build system for submodules Vendorize the submodules and a simple CMake build system for all them. The dependencies will inherit compilation options for core. The goal is to make Mapbox GL Core completely self contained with a simple offline build. --- CMakeLists.txt | 49 +++++++++++++++++++++--------------------- circle.yml | 5 ----- cmake/benchmark.cmake | 4 ---- cmake/core.cmake | 39 +++++++++++++++++++++------------ cmake/filesource.cmake | 6 ------ cmake/glfw.cmake | 3 --- cmake/icu.cmake | 26 ---------------------- cmake/mason-dependencies.cmake | 18 +--------------- cmake/node.cmake | 1 - cmake/nunicode.cmake | 5 ----- cmake/render.cmake | 1 - cmake/test.cmake | 15 +++++-------- cmake/vendor.cmake | 23 ++++++++++++++++++++ platform/android/config.cmake | 5 ----- platform/ios/config.cmake | 5 ----- platform/linux/config.cmake | 3 --- platform/macos/config.cmake | 5 ----- platform/qt/config.cmake | 20 ++--------------- platform/qt/qt.cmake | 2 -- scripts/nitpick/vendoring.js | 38 -------------------------------- vendor/earcut.hpp.cmake | 5 +++++ vendor/expected.cmake | 5 +++++ vendor/geojson-vt-cpp.cmake | 5 +++++ vendor/geojson.hpp.cmake | 5 +++++ vendor/geometry.hpp.cmake | 5 +++++ vendor/icu.cmake | 35 ++++++++++++++++++++++++++++++ vendor/kdbush.hpp.cmake | 5 +++++ vendor/nunicode.cmake | 21 ++++++++++++++++++ vendor/optional.cmake | 10 +++++++++ vendor/polylabel.cmake | 5 +++++ vendor/protozero.cmake | 5 +++++ vendor/rapidjson.cmake | 15 +++++++++++++ vendor/shelf-pack-cpp.cmake | 5 +++++ vendor/supercluster.hpp.cmake | 5 +++++ vendor/unique_resource.cmake | 5 +++++ vendor/variant.cmake | 5 +++++ vendor/vector-tile.cmake | 5 +++++ vendor/wagyu.cmake | 5 +++++ 38 files changed, 231 insertions(+), 193 deletions(-) delete mode 100644 cmake/icu.cmake delete mode 100644 cmake/nunicode.cmake create mode 100644 cmake/vendor.cmake delete mode 100755 scripts/nitpick/vendoring.js create mode 100644 vendor/earcut.hpp.cmake create mode 100644 vendor/expected.cmake create mode 100644 vendor/geojson-vt-cpp.cmake create mode 100644 vendor/geojson.hpp.cmake create mode 100644 vendor/geometry.hpp.cmake create mode 100644 vendor/icu.cmake create mode 100644 vendor/kdbush.hpp.cmake create mode 100644 vendor/nunicode.cmake create mode 100644 vendor/optional.cmake create mode 100644 vendor/polylabel.cmake create mode 100644 vendor/protozero.cmake create mode 100644 vendor/rapidjson.cmake create mode 100644 vendor/shelf-pack-cpp.cmake create mode 100644 vendor/supercluster.hpp.cmake create mode 100644 vendor/unique_resource.cmake create mode 100644 vendor/variant.cmake create mode 100644 vendor/vector-tile.cmake create mode 100644 vendor/wagyu.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index bb315916b4..91b0aa5c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,24 @@ cmake_minimum_required(VERSION 3.4) project(mbgl LANGUAGES CXX C) +set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo Sanitize) + +# Compiler configuration +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS OFF) +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) + +# Required to avoid warnings when setting visibility +cmake_policy(SET CMP0063 NEW) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_C_VISIBILITY_PRESET hidden) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + option(WITH_CXX11ABI "Use the C++11 ABI" OFF) option(WITH_COVERAGE "Enable coverage reports" OFF) option(WITH_OSMESA "Use OSMesa headless backend" OFF) @@ -8,6 +26,12 @@ option(WITH_EGL "Use EGL backend" OFF) option(WITH_NODEJS "Download test dependencies like NPM and Node.js" ON) option(WITH_ERROR "Add -Werror flag to build (turns warnings into errors)" ON) +if (WITH_ERROR) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") +endif() + +include(cmake/vendor.cmake) include(cmake/mbgl.cmake) include(cmake/mason.cmake) include(cmake/xcode.cmake) @@ -47,31 +71,11 @@ set_source_files_properties(src/mbgl/util/version.cpp PROPERTIES COMPILE_DEFINIT include(cmake/mason-dependencies.cmake) -add_definitions(-DRAPIDJSON_HAS_STDSTRING=1) - if(WITH_COVERAGE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") endif(WITH_COVERAGE) -set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo Sanitize) - -# Compiler configuration -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_C_EXTENSIONS OFF) -set(CMAKE_C_STANDARD 99) -set(CMAKE_C_STANDARD_REQUIRED ON) - -# Required to avoid warnings when setting visibility -cmake_policy(SET CMP0063 NEW) -set(CMAKE_CXX_VISIBILITY_PRESET hidden) -set(CMAKE_C_VISIBILITY_PRESET hidden) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) - if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-backtrace-limit=0 -w") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") @@ -80,11 +84,6 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wno-variadic-macros -Wno-unknown-pragmas") endif() -if (WITH_ERROR) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -endif() - if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # -Wno-error=unused-command-line-argument is required due to https://llvm.org/bugs/show_bug.cgi?id=7798 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-command-line-argument") diff --git a/circle.yml b/circle.yml index f08b6467be..75ed80b85d 100644 --- a/circle.yml +++ b/circle.yml @@ -477,11 +477,6 @@ jobs: name: Android code generation command: scripts/nitpick/generated-code.js android when: always - - run: - name: Vendored packages - command: scripts/nitpick/vendoring.js - when: always - # ------------------------------------------------------------------------------ clang-tidy: diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index 7e0fd76917..a392e1344d 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -15,10 +15,6 @@ target_link_libraries(mbgl-benchmark target_add_mason_package(mbgl-benchmark PRIVATE boost) target_add_mason_package(mbgl-benchmark PRIVATE benchmark) -target_add_mason_package(mbgl-benchmark PRIVATE geojson) -target_add_mason_package(mbgl-benchmark PRIVATE rapidjson) -target_add_mason_package(mbgl-benchmark PRIVATE protozero) -target_add_mason_package(mbgl-benchmark PRIVATE vector-tile) mbgl_platform_benchmark() diff --git a/cmake/core.cmake b/cmake/core.cmake index 32e77f5d55..04b5f9ea18 100644 --- a/cmake/core.cmake +++ b/cmake/core.cmake @@ -7,21 +7,32 @@ target_include_directories(mbgl-core PRIVATE src ) -target_add_mason_package(mbgl-core PUBLIC geometry) -target_add_mason_package(mbgl-core PUBLIC variant) -target_add_mason_package(mbgl-core PRIVATE unique_resource) -target_add_mason_package(mbgl-core PRIVATE rapidjson) +target_link_libraries(mbgl-core PRIVATE + earcut.hpp + expected + geojson-vt-cpp + kdbush.hpp + shelf-pack-cpp + supercluster.hpp + unique_resource + wagyu +) + +# FIXME: We should not leak these many +# libraries in our public interface. +target_link_libraries(mbgl-core PUBLIC + geojson.hpp + geometry.hpp + icu + optional + polylabel + protozero + rapidjson + variant + vector-tile +) + target_add_mason_package(mbgl-core PRIVATE boost) -target_add_mason_package(mbgl-core PRIVATE geojson) -target_add_mason_package(mbgl-core PRIVATE geojsonvt) -target_add_mason_package(mbgl-core PRIVATE supercluster) -target_add_mason_package(mbgl-core PRIVATE kdbush) -target_add_mason_package(mbgl-core PRIVATE earcut) -target_add_mason_package(mbgl-core PRIVATE protozero) -target_add_mason_package(mbgl-core PRIVATE polylabel) -target_add_mason_package(mbgl-core PRIVATE wagyu) -target_add_mason_package(mbgl-core PRIVATE shelf-pack) -target_add_mason_package(mbgl-core PRIVATE vector-tile) mbgl_platform_core() diff --git a/cmake/filesource.cmake b/cmake/filesource.cmake index cfb04a5ce9..67926b6d77 100644 --- a/cmake/filesource.cmake +++ b/cmake/filesource.cmake @@ -1,14 +1,8 @@ -add_vendor_target(expected INTERFACE) - # Modify cmake/filesource-files.txt to change the source files for this target. load_sources_list(MBGL_FILESOURCE_FILES cmake/filesource-files.txt) add_library(mbgl-filesource STATIC ${MBGL_FILESOURCE_FILES}) -target_add_mason_package(mbgl-filesource PUBLIC geometry) -target_add_mason_package(mbgl-filesource PUBLIC variant) -target_add_mason_package(mbgl-filesource PRIVATE rapidjson) target_add_mason_package(mbgl-filesource PRIVATE boost) -target_add_mason_package(mbgl-filesource PRIVATE geojson) target_include_directories(mbgl-filesource PRIVATE include diff --git a/cmake/glfw.cmake b/cmake/glfw.cmake index eacc72d338..7430cac9d2 100644 --- a/cmake/glfw.cmake +++ b/cmake/glfw.cmake @@ -21,10 +21,7 @@ target_link_libraries(mbgl-glfw ) target_add_mason_package(mbgl-glfw PRIVATE cheap-ruler) -target_add_mason_package(mbgl-glfw PRIVATE geojson) -target_add_mason_package(mbgl-glfw PRIVATE geometry) target_add_mason_package(mbgl-glfw PRIVATE glfw) -target_add_mason_package(mbgl-glfw PRIVATE variant) target_add_mason_package(mbgl-glfw PRIVATE args) mbgl_platform_glfw() diff --git a/cmake/icu.cmake b/cmake/icu.cmake deleted file mode 100644 index ba98c7737a..0000000000 --- a/cmake/icu.cmake +++ /dev/null @@ -1,26 +0,0 @@ -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 24a63fa4f5..ea638510d0 100644 --- a/cmake/mason-dependencies.cmake +++ b/cmake/mason-dependencies.cmake @@ -1,22 +1,8 @@ # All dependencies in a single separate file so its checksum can be used in a CI cache key name -mason_use(geometry VERSION 0.9.3 HEADER_ONLY) -mason_use(variant VERSION 1.1.4 HEADER_ONLY) -mason_use(unique_resource VERSION cba309e HEADER_ONLY) -mason_use(rapidjson VERSION 1.1.0 HEADER_ONLY) mason_use(boost VERSION 1.65.1 HEADER_ONLY) -mason_use(geojsonvt VERSION 6.6.2 HEADER_ONLY) -mason_use(supercluster VERSION 0.2.2 HEADER_ONLY) -mason_use(kdbush VERSION 0.1.1-1 HEADER_ONLY) -mason_use(earcut VERSION 0.12.4 HEADER_ONLY) -mason_use(protozero VERSION 1.5.2 HEADER_ONLY) -mason_use(pixelmatch VERSION 0.10.0 HEADER_ONLY) -mason_use(geojson VERSION 0.4.2 HEADER_ONLY) -mason_use(polylabel VERSION 1.0.3 HEADER_ONLY) -mason_use(wagyu VERSION 0.4.3 HEADER_ONLY) -mason_use(shelf-pack VERSION 2.1.1 HEADER_ONLY) mason_use(cheap-ruler VERSION 2.5.3 HEADER_ONLY) -mason_use(vector-tile VERSION 1.0.2 HEADER_ONLY) +mason_use(pixelmatch VERSION 0.10.0 HEADER_ONLY) if(MBGL_PLATFORM STREQUAL "android") mason_use(jni.hpp VERSION 4.0.1 HEADER_ONLY) @@ -42,8 +28,6 @@ elseif(MBGL_PLATFORM STREQUAL "macos") mason_use(swiftshader VERSION 2018-05-31) endif() elseif(MBGL_PLATFORM STREQUAL "qt") - mason_use(optional VERSION f27e7908 HEADER_ONLY) - if(NOT WITH_QT_DECODERS) mason_use(libjpeg-turbo VERSION 1.5.0) mason_use(libpng VERSION 1.6.25) diff --git a/cmake/node.cmake b/cmake/node.cmake index 6750adc03c..cb98d570f7 100644 --- a/cmake/node.cmake +++ b/cmake/node.cmake @@ -57,7 +57,6 @@ target_link_libraries(mbgl-node INTERFACE mbgl-loop-node ) -target_add_mason_package(mbgl-node INTERFACE geojson) set_target_properties(mbgl-node.all PROPERTIES FOLDER "Node.js") add_custom_target(mbgl-node.active DEPENDS mbgl-node.abi-${NodeJS_ABI}) diff --git a/cmake/nunicode.cmake b/cmake/nunicode.cmake deleted file mode 100644 index 4a0f4f2c8c..0000000000 --- a/cmake/nunicode.cmake +++ /dev/null @@ -1,5 +0,0 @@ -add_vendor_target(nunicode STATIC) - -target_compile_definitions(nunicode - PRIVATE "-DNU_BUILD_STATIC" -) diff --git a/cmake/render.cmake b/cmake/render.cmake index 781b7ff2aa..a65cc5bf1c 100644 --- a/cmake/render.cmake +++ b/cmake/render.cmake @@ -11,7 +11,6 @@ target_link_libraries(mbgl-render ) target_add_mason_package(mbgl-render PRIVATE boost) -target_add_mason_package(mbgl-render PRIVATE geojson) target_add_mason_package(mbgl-render PRIVATE args) mbgl_platform_render() diff --git a/cmake/test.cmake b/cmake/test.cmake index 7d86dfdde8..05cc17c98e 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -22,20 +22,15 @@ target_include_directories(mbgl-test PRIVATE platform/default ) -target_link_libraries(mbgl-test - PRIVATE mbgl-core - PRIVATE gtest +target_link_libraries(mbgl-test PRIVATE + gtest + mbgl-core + shelf-pack-cpp + unique_resource ) -target_add_mason_package(mbgl-test PRIVATE geometry) -target_add_mason_package(mbgl-test PRIVATE variant) -target_add_mason_package(mbgl-test PRIVATE unique_resource) -target_add_mason_package(mbgl-test PRIVATE rapidjson) target_add_mason_package(mbgl-test PRIVATE pixelmatch) target_add_mason_package(mbgl-test PRIVATE boost) -target_add_mason_package(mbgl-test PRIVATE geojson) -target_add_mason_package(mbgl-test PRIVATE geojsonvt) -target_add_mason_package(mbgl-test PRIVATE shelf-pack) mbgl_platform_test() diff --git a/cmake/vendor.cmake b/cmake/vendor.cmake new file mode 100644 index 0000000000..1aa522f92c --- /dev/null +++ b/cmake/vendor.cmake @@ -0,0 +1,23 @@ +execute_process( + COMMAND git submodule update --init . + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/vendor +) + +include(${CMAKE_SOURCE_DIR}/vendor/earcut.hpp.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/expected.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/geojson-vt-cpp.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/geojson.hpp.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/geometry.hpp.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/icu.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/kdbush.hpp.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/nunicode.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/optional.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/polylabel.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/protozero.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/rapidjson.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/shelf-pack-cpp.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/supercluster.hpp.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/unique_resource.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/variant.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/vector-tile.cmake) +include(${CMAKE_SOURCE_DIR}/vendor/wagyu.cmake) diff --git a/platform/android/config.cmake b/platform/android/config.cmake index ec64b239f8..0e10e2af10 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -1,7 +1,6 @@ set(USE_GLES2 ON) include(cmake/sqlite.cmake) -include(cmake/icu.cmake) # Build thin archives. set(CMAKE_CXX_ARCHIVE_CREATE " cruT ") @@ -43,13 +42,9 @@ macro(mbgl_platform_core) PRIVATE platform/android ) - 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_link_libraries(mbgl-core - PRIVATE icu - PUBLIC expected PUBLIC -llog PUBLIC -landroid PUBLIC -ljnigraphics diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake index 471c1183a5..320ef7e73b 100644 --- a/platform/ios/config.cmake +++ b/platform/ios/config.cmake @@ -12,7 +12,6 @@ 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,16 +60,12 @@ macro(mbgl_platform_core) PRIVATE platform/default/mbgl/util/default_thread_pool.cpp ) - target_add_mason_package(mbgl-core PUBLIC geojson) - target_add_mason_package(mbgl-core PUBLIC polylabel) - target_include_directories(mbgl-core PUBLIC platform/darwin PUBLIC platform/default ) target_link_libraries(mbgl-core - PRIVATE icu PUBLIC "-lz" PUBLIC "-framework Foundation" PUBLIC "-framework CoreText" diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake index a81f5d65ad..cfbf4ef8a2 100644 --- a/platform/linux/config.cmake +++ b/platform/linux/config.cmake @@ -1,6 +1,4 @@ -include(cmake/nunicode.cmake) include(cmake/sqlite.cmake) -include(cmake/icu.cmake) add_library(mbgl-loop-uv STATIC platform/default/async_task.cpp @@ -84,7 +82,6 @@ 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 geojson) target_link_libraries(mbgl-core PRIVATE nunicode diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index 1fb09e066e..3b5b2a8529 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -1,6 +1,5 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11) -include(cmake/icu.cmake) include(cmake/loop-darwin.cmake) macro(mbgl_platform_core) @@ -54,9 +53,6 @@ macro(mbgl_platform_core) ) endif() - target_add_mason_package(mbgl-core PUBLIC geojson) - target_add_mason_package(mbgl-core PUBLIC polylabel) - target_compile_options(mbgl-core PRIVATE -fobjc-arc ) @@ -67,7 +63,6 @@ macro(mbgl_platform_core) ) target_link_libraries(mbgl-core - PRIVATE icu PUBLIC "-lz" PUBLIC "-framework Foundation" PUBLIC "-framework CoreText" diff --git a/platform/qt/config.cmake b/platform/qt/config.cmake index 9f7ee24cfb..a2c6b0a9e9 100644 --- a/platform/qt/config.cmake +++ b/platform/qt/config.cmake @@ -1,9 +1,4 @@ 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 @@ -16,9 +11,9 @@ macro(mbgl_platform_core) PRIVATE platform/qt/include ) - target_link_libraries(mbgl-core + target_link_libraries(mbgl-core PRIVATE ${MBGL_QT_CORE_LIBRARIES} - PRIVATE nunicode + nunicode ) if(NOT WITH_QT_DECODERS) @@ -39,10 +34,6 @@ macro(mbgl_platform_core) else() target_sources(mbgl-core PRIVATE platform/qt/src/bidi.cpp) endif() - - if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - target_add_mason_package(mbgl-core PRIVATE optional) - endif() endmacro() @@ -54,10 +45,6 @@ macro(mbgl_filesource) target_link_libraries(mbgl-filesource ${MBGL_QT_FILESOURCE_LIBRARIES} ) - - if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - target_add_mason_package(mbgl-filesource PRIVATE optional) - endif() endmacro() # FIXME: For now tests are disabled on Windows until we @@ -86,6 +73,3 @@ if (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") ) endmacro() endif() - -target_add_mason_package(qmapboxgl PRIVATE geojson) -target_add_mason_package(qmapboxgl PRIVATE rapidjson) diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 323c616a64..4e781866e6 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -158,8 +158,6 @@ elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") list(APPEND MBGL_QT_CORE_FILES PRIVATE platform/qt/src/thread.cpp ) - - target_add_mason_package(qmapboxgl PRIVATE optional) elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "QNX") list(APPEND MBGL_QT_CORE_FILES PRIVATE platform/qt/src/thread.cpp diff --git a/scripts/nitpick/vendoring.js b/scripts/nitpick/vendoring.js deleted file mode 100755 index 07f39ddbc8..0000000000 --- a/scripts/nitpick/vendoring.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node -const nitpick = require('.'); -const fs = require('fs'); -const {execSync} = require('child_process'); - -const head = process.env['CIRCLE_SHA1']; -const mergeBase = process.env['CIRCLE_MERGE_BASE']; -if (!mergeBase) { - console.log('No merge base available.'); - return; -} - -const checkAll = process.argv.indexOf('--check-all') >= 2; - -// Run the vendoring script for all vendored packages that were modified in this PR, and check for changes. -fs.readdirSync('vendor') - .filter(name => name[0] != '.') - .filter(name => fs.statSync(`vendor/${name}`).isDirectory()) - .filter(name => checkAll || execSync(`git diff --shortstat ${mergeBase} ${head} -- vendor/${name}`).toString().trim()) - .forEach(name => { - execSync(`scripts/vendor/${name}.sh`); - - // List missing files - var missing = execSync(`git ls-files --others --exclude-standard -- vendor/${name}`).toString().trim(); - if (!missing.length) { - nitpick.ok(`All files vendored for ${name} are checked in`); - } else { - nitpick.fail(`These vendored files for ${name} are not checked in:`, missing); - } - - // Diff existing files - const diff = execSync(`git -c color.ui=always diff -- vendor/${name}`).toString().trim(); - if (!diff.length) { - nitpick.ok(`All files vendored for ${name} are unmodified`); - } else { - nitpick.fail(`These vendored files for ${name} have modifications:`, diff); - } - }); diff --git a/vendor/earcut.hpp.cmake b/vendor/earcut.hpp.cmake new file mode 100644 index 0000000000..d7992cda50 --- /dev/null +++ b/vendor/earcut.hpp.cmake @@ -0,0 +1,5 @@ +add_library(earcut.hpp INTERFACE) + +target_include_directories(earcut.hpp SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/earcut.hpp/include +) diff --git a/vendor/expected.cmake b/vendor/expected.cmake new file mode 100644 index 0000000000..ebe63e1a10 --- /dev/null +++ b/vendor/expected.cmake @@ -0,0 +1,5 @@ +add_library(expected INTERFACE) + +target_include_directories(expected SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/expected/include +) diff --git a/vendor/geojson-vt-cpp.cmake b/vendor/geojson-vt-cpp.cmake new file mode 100644 index 0000000000..c8d955f64b --- /dev/null +++ b/vendor/geojson-vt-cpp.cmake @@ -0,0 +1,5 @@ +add_library(geojson-vt-cpp INTERFACE) + +target_include_directories(geojson-vt-cpp SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/geojson-vt-cpp/include +) diff --git a/vendor/geojson.hpp.cmake b/vendor/geojson.hpp.cmake new file mode 100644 index 0000000000..261650388f --- /dev/null +++ b/vendor/geojson.hpp.cmake @@ -0,0 +1,5 @@ +add_library(geojson.hpp INTERFACE) + +target_include_directories(geojson.hpp SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/geojson.hpp/include +) diff --git a/vendor/geometry.hpp.cmake b/vendor/geometry.hpp.cmake new file mode 100644 index 0000000000..d97c2a9f6c --- /dev/null +++ b/vendor/geometry.hpp.cmake @@ -0,0 +1,5 @@ +add_library(geometry.hpp INTERFACE) + +target_include_directories(geometry.hpp SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/geometry.hpp/include +) diff --git a/vendor/icu.cmake b/vendor/icu.cmake new file mode 100644 index 0000000000..3d29b799ed --- /dev/null +++ b/vendor/icu.cmake @@ -0,0 +1,35 @@ +add_library(icu STATIC + ${CMAKE_SOURCE_DIR}/vendor/icu/src/cmemory.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/cstring.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/ubidi.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/ubidi_props.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/ubidiln.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/ubidiwrt.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/uchar.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/udataswp.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/uinvchar.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/umath.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/ushape.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/ustring.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/utf_impl.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/utrie2.cpp + ${CMAKE_SOURCE_DIR}/vendor/icu/src/utypes.cpp +) + +target_compile_definitions(icu PRIVATE + UCONFIG_NO_BREAK_ITERATION=1 + UCONFIG_NO_LEGACY_CONVERSION=1 + U_CHARSET_IS_UTF8=1 + U_CHAR_TYPE=uint_least16_t + U_HAVE_ATOMIC=1 + U_HAVE_STRTOD_L=0 + _REENTRANT +) + +target_compile_options(icu PRIVATE + -Wno-error +) + +target_include_directories(icu SYSTEM PUBLIC + ${CMAKE_SOURCE_DIR}/vendor/icu/include +) diff --git a/vendor/kdbush.hpp.cmake b/vendor/kdbush.hpp.cmake new file mode 100644 index 0000000000..450530b7c6 --- /dev/null +++ b/vendor/kdbush.hpp.cmake @@ -0,0 +1,5 @@ +add_library(kdbush.hpp INTERFACE) + +target_include_directories(kdbush.hpp SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/kdbush.hpp/include +) diff --git a/vendor/nunicode.cmake b/vendor/nunicode.cmake new file mode 100644 index 0000000000..d318b8a265 --- /dev/null +++ b/vendor/nunicode.cmake @@ -0,0 +1,21 @@ +add_library(nunicode STATIC + ${CMAKE_SOURCE_DIR}/vendor/nunicode/src/libnu/ducet.c + ${CMAKE_SOURCE_DIR}/vendor/nunicode/src/libnu/strcoll.c + ${CMAKE_SOURCE_DIR}/vendor/nunicode/src/libnu/strings.c + ${CMAKE_SOURCE_DIR}/vendor/nunicode/src/libnu/tolower.c + ${CMAKE_SOURCE_DIR}/vendor/nunicode/src/libnu/tounaccent.c + ${CMAKE_SOURCE_DIR}/vendor/nunicode/src/libnu/toupper.c + ${CMAKE_SOURCE_DIR}/vendor/nunicode/src/libnu/utf8.c +) + +target_compile_definitions(nunicode PRIVATE + NU_BUILD_STATIC +) + +target_compile_options(nunicode PRIVATE + -Wno-error +) + +target_include_directories(nunicode SYSTEM PUBLIC + ${CMAKE_SOURCE_DIR}/vendor/nunicode/include +) diff --git a/vendor/optional.cmake b/vendor/optional.cmake new file mode 100644 index 0000000000..157ccc991d --- /dev/null +++ b/vendor/optional.cmake @@ -0,0 +1,10 @@ +add_library(optional INTERFACE) + +# This polyfill is really only needed for +# Windows. We need to be careful to not leak +# it into any of our public interfaces. +if(WIN32) + target_include_directories(optional SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/optional/include + ) +endif() diff --git a/vendor/polylabel.cmake b/vendor/polylabel.cmake new file mode 100644 index 0000000000..d732723a89 --- /dev/null +++ b/vendor/polylabel.cmake @@ -0,0 +1,5 @@ +add_library(polylabel INTERFACE) + +target_include_directories(polylabel SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/polylabel/include +) diff --git a/vendor/protozero.cmake b/vendor/protozero.cmake new file mode 100644 index 0000000000..e4f32f1ace --- /dev/null +++ b/vendor/protozero.cmake @@ -0,0 +1,5 @@ +add_library(protozero INTERFACE) + +target_include_directories(protozero SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/protozero/include +) diff --git a/vendor/rapidjson.cmake b/vendor/rapidjson.cmake new file mode 100644 index 0000000000..40b5c31895 --- /dev/null +++ b/vendor/rapidjson.cmake @@ -0,0 +1,15 @@ +add_library(rapidjson INTERFACE) + +target_include_directories(rapidjson SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/rapidjson/include +) + +target_compile_definitions(rapidjson INTERFACE + RAPIDJSON_HAS_STDSTRING=1 +) + +if(WIN32) + target_compile_definitions(rapidjson INTERFACE + RAPIDJSON_HAS_CXX11_RVALUE_REFS + ) +endif() diff --git a/vendor/shelf-pack-cpp.cmake b/vendor/shelf-pack-cpp.cmake new file mode 100644 index 0000000000..0d8e850723 --- /dev/null +++ b/vendor/shelf-pack-cpp.cmake @@ -0,0 +1,5 @@ +add_library(shelf-pack-cpp INTERFACE) + +target_include_directories(shelf-pack-cpp SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/shelf-pack-cpp/include +) diff --git a/vendor/supercluster.hpp.cmake b/vendor/supercluster.hpp.cmake new file mode 100644 index 0000000000..90d0becade --- /dev/null +++ b/vendor/supercluster.hpp.cmake @@ -0,0 +1,5 @@ +add_library(supercluster.hpp INTERFACE) + +target_include_directories(supercluster.hpp SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/supercluster.hpp/include +) diff --git a/vendor/unique_resource.cmake b/vendor/unique_resource.cmake new file mode 100644 index 0000000000..ad450066eb --- /dev/null +++ b/vendor/unique_resource.cmake @@ -0,0 +1,5 @@ +add_library(unique_resource INTERFACE) + +target_include_directories(unique_resource SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/unique_resource +) diff --git a/vendor/variant.cmake b/vendor/variant.cmake new file mode 100644 index 0000000000..f4827f41c6 --- /dev/null +++ b/vendor/variant.cmake @@ -0,0 +1,5 @@ +add_library(variant INTERFACE) + +target_include_directories(variant SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/variant/include +) diff --git a/vendor/vector-tile.cmake b/vendor/vector-tile.cmake new file mode 100644 index 0000000000..ec4552afcc --- /dev/null +++ b/vendor/vector-tile.cmake @@ -0,0 +1,5 @@ +add_library(vector-tile INTERFACE) + +target_include_directories(vector-tile SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/vector-tile/include +) diff --git a/vendor/wagyu.cmake b/vendor/wagyu.cmake new file mode 100644 index 0000000000..7cf3397b89 --- /dev/null +++ b/vendor/wagyu.cmake @@ -0,0 +1,5 @@ +add_library(wagyu INTERFACE) + +target_include_directories(wagyu SYSTEM INTERFACE + ${CMAKE_SOURCE_DIR}/vendor/wagyu/include +) -- cgit v1.2.1