diff --git a/.gitmodules b/.gitmodules index 999ddb7c6..c0e48e39b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,16 +62,13 @@ path = vendor/PMTiles url = https://github.com/protomaps/PMTiles.git [submodule "vendor/maplibre-native-base/extras/args"] - path = vendor/maplibre-native-base/extras/args + path = vendor/args url = https://github.com/Taywee/args.git [submodule "vendor/maplibre-native-base/extras/expected-lite"] - path = vendor/maplibre-native-base/extras/expected-lite + path = vendor/expected-lite url = https://github.com/martinmoene/expected-lite.git -[submodule "vendor/maplibre-native-base/extras/kdbush.hpp"] - path = vendor/maplibre-native-base/extras/kdbush.hpp - url = https://github.com/mourner/kdbush.hpp.git [submodule "vendor/maplibre-native-base/extras/rapidjson"] - path = vendor/maplibre-native-base/extras/rapidjson + path = vendor/rapidjson url = https://github.com/Tencent/rapidjson.git [submodule "vendor/maplibre-native-base/deps/cheap-ruler-cpp"] path = vendor/maplibre-native-base/deps/cheap-ruler-cpp @@ -95,7 +92,7 @@ path = vendor/maplibre-native-base/deps/shelf-pack-cpp url = https://github.com/mapbox/shelf-pack-cpp.git [submodule "vendor/maplibre-native-base/deps/supercluster.hpp"] - path = vendor/maplibre-native-base/deps/supercluster.hpp + path = vendor/supercluster url = https://github.com/mapbox/supercluster.hpp.git [submodule "vendor/maplibre-native-base/deps/variant"] path = vendor/maplibre-native-base/deps/variant @@ -104,5 +101,8 @@ path = vendor/maplibre-native-base/deps/geojson.hpp url = https://github.com/mapbox/geojson-cpp.git [submodule "vendor/maplibre-native-base/extras/filesystem"] - path = vendor/maplibre-native-base/extras/filesystem + path = vendor/filesystem url = https://github.com/gulrak/filesystem.git +[submodule "vendor/kdbush.hpp"] + path = vendor/kdbush.hpp + url = https://github.com/mourner/kdbush.hpp.git diff --git a/BUILD.bazel b/BUILD.bazel index 5b39985d1..5f368cda4 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -135,17 +135,21 @@ cc_library( "//vendor:boost", "//vendor:earcut.hpp", "//vendor:eternal", + "//vendor:expected-lite", "//vendor:maplibre-native-base", "//vendor:parsedate", "//vendor:pmtiles", "//vendor:polylabel", "//vendor:protozero", + "//vendor:rapidjson", + "//vendor:supercluster.hpp", "//vendor:unique_resource", "//vendor:unordered_dense", "//vendor:vector-tile", "//vendor:wagyu", ] + select({ "@platforms//os:ios": [ + "//vendor:ghc_filesystem", "//vendor:icu", ], "@platforms//os:osx": [ diff --git a/CMakeLists.txt b/CMakeLists.txt index f2bd567b7..064f8a785 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1417,10 +1417,12 @@ target_include_directories( PUBLIC ${PROJECT_SOURCE_DIR}/include ) +include(${PROJECT_SOURCE_DIR}/vendor/args.cmake) include(${PROJECT_SOURCE_DIR}/vendor/boost.cmake) include(${PROJECT_SOURCE_DIR}/vendor/csscolorparser.cmake) include(${PROJECT_SOURCE_DIR}/vendor/earcut.hpp.cmake) include(${PROJECT_SOURCE_DIR}/vendor/eternal.cmake) +include(${PROJECT_SOURCE_DIR}/vendor/rapidjson.cmake) include(${PROJECT_SOURCE_DIR}/vendor/maplibre-native-base.cmake) include(${PROJECT_SOURCE_DIR}/vendor/parsedate.cmake) include(${PROJECT_SOURCE_DIR}/vendor/pmtiles.cmake) @@ -1432,6 +1434,10 @@ include(${PROJECT_SOURCE_DIR}/vendor/unordered_dense.cmake) include(${PROJECT_SOURCE_DIR}/vendor/vector-tile.cmake) include(${PROJECT_SOURCE_DIR}/vendor/wagyu.cmake) include(${PROJECT_SOURCE_DIR}/vendor/metal-cpp.cmake) +include(${PROJECT_SOURCE_DIR}/vendor/supercluster.cmake) +include(${PROJECT_SOURCE_DIR}/vendor/expected-lite.cmake) +include(${PROJECT_SOURCE_DIR}/vendor/kdbush.cmake) +include(${PROJECT_SOURCE_DIR}/vendor/filesystem.cmake) if(MLN_USE_RUST) include(${PROJECT_SOURCE_DIR}/rustutils/rustutils.cmake) @@ -1440,8 +1446,7 @@ endif() target_link_libraries( mbgl-core PRIVATE - MapLibreNative::Base::Extras::kdbush.hpp - MapLibreNative::Base::supercluster.hpp + mbgl-vendor-kdbush MapLibreNative::Base::shelf-pack-cpp MapLibreNative::Base::geojson-vt-cpp MapLibreNative::Base::cheap-ruler-cpp @@ -1453,6 +1458,7 @@ target_link_libraries( mbgl-vendor-pmtiles mbgl-vendor-polylabel mbgl-vendor-protozero + mbgl-vendor-supercluster mbgl-vendor-unique_resource mbgl-vendor-vector-tile mbgl-vendor-wagyu @@ -1461,8 +1467,8 @@ target_link_libraries( ${SHAPE_TARGETS} # from harfbuzz.cmake PUBLIC MapLibreNative::Base - MapLibreNative::Base::Extras::expected-lite - MapLibreNative::Base::Extras::rapidjson + mbgl-vendor-expected-lite + mbgl-vendor-rapidjson MapLibreNative::Base::geojson.hpp MapLibreNative::Base::geometry.hpp MapLibreNative::Base::variant @@ -1474,22 +1480,21 @@ set(EXPORT_TARGETS mbgl-core maplibre-native-base maplibre-native-base-cheap-ruler-cpp - maplibre-native-base-extras-filesystem - maplibre-native-base-extras-expected-lite - maplibre-native-base-extras-kdbush.hpp - maplibre-native-base-extras-rapidjson + mbgl-vendor-expected-lite + mbgl-vendor-kdbush maplibre-native-base-geojson-vt-cpp maplibre-native-base-geojson.hpp maplibre-native-base-geometry.hpp maplibre-native-base-jni.hpp maplibre-native-base-pixelmatch-cpp maplibre-native-base-shelf-pack-cpp - maplibre-native-base-supercluster.hpp + mbgl-vendor-supercluster maplibre-native-base-variant mbgl-compiler-options mbgl-vendor-boost mbgl-vendor-earcut.hpp mbgl-vendor-eternal + mbgl-vendor-rapidjson mbgl-vendor-parsedate mbgl-vendor-pmtiles mbgl-vendor-polylabel @@ -1498,6 +1503,7 @@ set(EXPORT_TARGETS mbgl-vendor-vector-tile mbgl-vendor-wagyu mbgl-vendor-metal-cpp + mbgl-vendor-filesystem unordered_dense ${SHAPE_TARGETS} # from harfbuzz.cmake ) diff --git a/bin/BUILD.bazel b/bin/BUILD.bazel index a7b8d4b73..1095eeb2d 100644 --- a/bin/BUILD.bazel +++ b/bin/BUILD.bazel @@ -9,6 +9,7 @@ cc_binary( copts = CPP_FLAGS + MAPLIBRE_FLAGS, deps = [ "//platform:macos-objcpp", + "//vendor:args", ], ) @@ -20,5 +21,6 @@ cc_binary( copts = CPP_FLAGS + MAPLIBRE_FLAGS, deps = [ "//platform:macos-objcpp", + "//vendor:args", ], ) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 351d9e55b..57add281b 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -7,7 +7,7 @@ target_link_libraries( mbgl-cache PRIVATE MapLibreNative::Base - MapLibreNative::Base::Extras::args + mbgl-vendor-args mbgl-compiler-options mbgl-core ) @@ -19,7 +19,7 @@ add_executable( target_link_libraries( mbgl-offline - PRIVATE MapLibreNative::Base::Extras::args mbgl-compiler-options mbgl-core + PRIVATE mbgl-vendor-args mbgl-compiler-options mbgl-core ) add_executable( @@ -29,7 +29,7 @@ add_executable( target_link_libraries( mbgl-render - PRIVATE MapLibreNative::Base::Extras::args mbgl-compiler-options mbgl-core + PRIVATE mbgl-vendor-args mbgl-compiler-options mbgl-core ) if(WIN32) diff --git a/expression-test/BUILD.bazel b/expression-test/BUILD.bazel index eb4803c11..fc40940df 100644 --- a/expression-test/BUILD.bazel +++ b/expression-test/BUILD.bazel @@ -34,6 +34,8 @@ cc_test( "//metrics:expression-test-files", ], deps = [ + # FIXME: allow compilation on other platforms "//platform/linux:impl", + "//vendor:args", ], ) diff --git a/expression-test/CMakeLists.txt b/expression-test/CMakeLists.txt index e71d3a89f..46df875c1 100644 --- a/expression-test/CMakeLists.txt +++ b/expression-test/CMakeLists.txt @@ -21,7 +21,7 @@ target_link_libraries( mbgl-expression-test PRIVATE MapLibreNative::Base - MapLibreNative::Base::Extras::args + mbgl-vendor-args mbgl-core mbgl-compiler-options ) diff --git a/platform/glfw/BUILD.bazel b/platform/glfw/BUILD.bazel index 447d349c1..d0fdd1709 100644 --- a/platform/glfw/BUILD.bazel +++ b/platform/glfw/BUILD.bazel @@ -13,6 +13,7 @@ objc_library( copts = CPP_FLAGS + MAPLIBRE_FLAGS, deps = [ "//:maplibre_lib", + "//vendor:args", "@glfw", ], ) diff --git a/platform/glfw/CMakeLists.txt b/platform/glfw/CMakeLists.txt index aea224a0d..b9a0234d8 100644 --- a/platform/glfw/CMakeLists.txt +++ b/platform/glfw/CMakeLists.txt @@ -110,8 +110,8 @@ endif() target_link_libraries( mbgl-glfw PRIVATE - MapLibreNative::Base::Extras::args - MapLibreNative::Base::Extras::rapidjson + mbgl-vendor-args + mbgl-vendor-rapidjson Mapbox::Map mbgl-compiler-options MapLibreNative::Base::cheap-ruler-cpp diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake index 78ea7f6a6..94086cad4 100644 --- a/platform/ios/ios.cmake +++ b/platform/ios/ios.cmake @@ -7,7 +7,7 @@ target_include_directories( target_link_libraries( mbgl-core PRIVATE - MapLibreNative::Base::Extras::filesystem + mbgl-vendor-filesystem ) file(GLOB_RECURSE IOS_SDK_SOURCE_FILES diff --git a/render-test/BUILD.bazel b/render-test/BUILD.bazel index deaf71e79..0a140af6f 100644 --- a/render-test/BUILD.bazel +++ b/render-test/BUILD.bazel @@ -34,6 +34,7 @@ cc_library( ], deps = [ "//expression-test:test_runner_common", + "//vendor:args", ] + select({ "@platforms//os:ios": ["//platform:ios-sdk"], "@platforms//os:linux": ["//platform/linux:impl"], diff --git a/render-test/CMakeLists.txt b/render-test/CMakeLists.txt index 545ecb4ef..3e2a34f03 100644 --- a/render-test/CMakeLists.txt +++ b/render-test/CMakeLists.txt @@ -57,7 +57,7 @@ include(${PROJECT_SOURCE_DIR}/vendor/boost.cmake) target_link_libraries( mbgl-render-test PRIVATE - MapLibreNative::Base::Extras::args + mbgl-vendor-args MapLibreNative::Base::pixelmatch-cpp mbgl-compiler-options mbgl-vendor-boost diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2b21d7f23..05189deee 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -227,7 +227,7 @@ target_link_libraries( mbgl-test PRIVATE ${MLN_CORE_PRIVATE_LIBRARIES} - MapLibreNative::Base::Extras::args + mbgl-vendor-args MapLibreNative::Base::pixelmatch-cpp mbgl-compiler-options mbgl-vendor-cpp-httplib diff --git a/vendor/BUILD.bazel b/vendor/BUILD.bazel index d42586573..7744c326d 100644 --- a/vendor/BUILD.bazel +++ b/vendor/BUILD.bazel @@ -3,9 +3,7 @@ load("//bazel:flags.bzl", "CPP_FLAGS") cc_library( name = "maplibre-native-base", - hdrs = [ - "maplibre-native-base/extras/args/args.hxx", - ] + glob( + hdrs = glob( [ "maplibre-native-base/deps/cheap-ruler-cpp/include/mapbox/*.hpp", "maplibre-native-base/deps/geojson-vt-cpp/include/**/*.hpp", @@ -14,18 +12,12 @@ cc_library( "maplibre-native-base/deps/jni.hpp/include/jni/*.hpp", "maplibre-native-base/deps/pixelmatch-cpp/include/mapbox/*.hpp", "maplibre-native-base/deps/shelf-pack-cpp/include/**/*.hpp", - "maplibre-native-base/deps/supercluster.hpp/include/*.hpp", "maplibre-native-base/deps/variant/include/mapbox/*.hpp", - "maplibre-native-base/extras/expected-lite/include/**/*.hpp", - "maplibre-native-base/extras/filesystem/include/ghc/*.hpp", - "maplibre-native-base/extras/kdbush.hpp/include/*.hpp", - "maplibre-native-base/extras/rapidjson/include/**/*.h", "maplibre-native-base/include/mapbox/**/*.hpp", ], exclude = ["maplibre-native-base/deps/jni.hpp/include/jni/string_conversion.hpp"], ), copts = CPP_FLAGS, - defines = ["RAPIDJSON_HAS_STDSTRING=1"], includes = [ "maplibre-native-base/deps/cheap-ruler-cpp/include", "maplibre-native-base/deps/geojson.hpp/include", @@ -34,18 +26,56 @@ cc_library( "maplibre-native-base/deps/jni.hpp/include", "maplibre-native-base/deps/pixelmatch-cpp/include", "maplibre-native-base/deps/shelf-pack-cpp/include", - "maplibre-native-base/deps/supercluster.hpp/include", "maplibre-native-base/deps/variant/include", - "maplibre-native-base/extras/args", - "maplibre-native-base/extras/expected-lite/include", - "maplibre-native-base/extras/filesystem/include", - "maplibre-native-base/extras/kdbush.hpp/include", - "maplibre-native-base/extras/rapidjson/include", "maplibre-native-base/include", ], visibility = ["//visibility:public"], ) +# vendor/kdbush +cc_library( + name = "kdbush", + hdrs = glob([ + "kdbush.hpp/include/*.hpp", + ]), + copts = CPP_FLAGS, + includes = [ + "kdbush.hpp/include", + ], +) + +cc_library( + name = "ghc_filesystem", + hdrs = glob([ + "filesystem/include/ghc/*.hpp", + ]), + copts = CPP_FLAGS, + includes = [ + "filesystem/include", + ], + visibility = ["//visibility:public"], +) + +# vendor/args +cc_library( + name = "args", + hdrs = ["args/args.hxx"], + includes = ["args"], + visibility = ["//visibility:public"], +) + +# vendor/args +cc_library( + name = "expected-lite", + hdrs = glob([ + "expected-lite/include/**/*.hpp", + ]), + includes = [ + "expected-lite/include", + ], + visibility = ["//visibility:public"], +) + # vendor/parsedate cc_library( name = "parsedate", @@ -127,6 +157,28 @@ cc_library( visibility = ["//visibility:public"], ) +# vendor/supercluster.hpp +cc_library( + name = "supercluster.hpp", + hdrs = ["supercluster/include/supercluster.hpp"], + copts = CPP_FLAGS, + includes = ["supercluster/include"], + visibility = ["//visibility:public"], + deps = ["kdbush"], +) + +# vendor/rapidjson +cc_library( + name = "rapidjson", + hdrs = glob([ + "rapidjson/include/**/*.h", + ]), + copts = CPP_FLAGS, + defines = ["RAPIDJSON_HAS_STDSTRING=1"], + includes = ["rapidjson/include"], + visibility = ["//visibility:public"], +) + # vendor/earcut.hpp-files.json cc_library( name = "earcut.hpp", diff --git a/vendor/maplibre-native-base/extras/args b/vendor/args similarity index 100% rename from vendor/maplibre-native-base/extras/args rename to vendor/args diff --git a/vendor/args.cmake b/vendor/args.cmake new file mode 100644 index 000000000..9f596db79 --- /dev/null +++ b/vendor/args.cmake @@ -0,0 +1,21 @@ +if(TARGET mbgl-vendor-args) + return() +endif() + +add_library( + mbgl-vendor-args INTERFACE +) + +target_include_directories( + mbgl-vendor-args SYSTEM + INTERFACE ${CMAKE_CURRENT_LIST_DIR}/args +) + +set_target_properties( + mbgl-vendor-args + PROPERTIES + INTERFACE_MAPLIBRE_NAME "args" + INTERFACE_MAPLIBRE_URL "https://github.com/Taywee/args" + INTERFACE_MAPLIBRE_AUTHOR "Taylor C. Richberger" + INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/args/LICENSE +) diff --git a/vendor/maplibre-native-base/extras/expected-lite b/vendor/expected-lite similarity index 100% rename from vendor/maplibre-native-base/extras/expected-lite rename to vendor/expected-lite diff --git a/vendor/expected-lite.cmake b/vendor/expected-lite.cmake new file mode 100644 index 000000000..fa1fd7987 --- /dev/null +++ b/vendor/expected-lite.cmake @@ -0,0 +1,21 @@ +if(TARGET mbgl-vendor-expected-lite) + return() +endif() + +add_library( + mbgl-vendor-expected-lite INTERFACE +) + +target_include_directories( + mbgl-vendor-expected-lite SYSTEM + INTERFACE ${CMAKE_CURRENT_LIST_DIR}/expected-lite/include +) + +set_target_properties( + mbgl-vendor-expected-lite + PROPERTIES + INTERFACE_MAPLIBRE_NAME "expected-lite" + INTERFACE_MAPLIBRE_URL "https://github.com/martinmoene/expected-lite" + INTERFACE_MAPLIBRE_AUTHOR "Martin Moene" + INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/expected-lite/LICENSE.txt +) diff --git a/vendor/maplibre-native-base/extras/filesystem b/vendor/filesystem similarity index 100% rename from vendor/maplibre-native-base/extras/filesystem rename to vendor/filesystem diff --git a/vendor/filesystem.cmake b/vendor/filesystem.cmake new file mode 100644 index 000000000..3fd9f8dec --- /dev/null +++ b/vendor/filesystem.cmake @@ -0,0 +1,21 @@ +if(TARGET mbgl-vendor-filesystem) + return() +endif() + +add_library( + mbgl-vendor-filesystem INTERFACE +) + +target_include_directories( + mbgl-vendor-filesystem SYSTEM + INTERFACE ${CMAKE_CURRENT_LIST_DIR}/filesystem/include +) + +set_target_properties( + mbgl-vendor-filesystem + PROPERTIES + INTERFACE_MAPLIBRE_NAME "filesystem" + INTERFACE_MAPLIBRE_URL "https://github.com/gulrak/filesystem" + INTERFACE_MAPLIBRE_AUTHOR "Steffen Schümann" + INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/filesystem/LICENSE +) diff --git a/vendor/kdbush.cmake b/vendor/kdbush.cmake new file mode 100644 index 000000000..7f1b10bdc --- /dev/null +++ b/vendor/kdbush.cmake @@ -0,0 +1,21 @@ +if(TARGET mbgl-vendor-kdbush) + return() +endif() + +add_library( + mbgl-vendor-kdbush INTERFACE +) + +target_include_directories( + mbgl-vendor-kdbush SYSTEM + INTERFACE ${CMAKE_CURRENT_LIST_DIR}/kdbush.hpp/include +) + +set_target_properties( + mbgl-vendor-kdbush + PROPERTIES + INTERFACE_MAPLIBRE_NAME "kdbush.hpp" + INTERFACE_MAPLIBRE_URL "https://github.com/mourner/kdbush.hpp" + INTERFACE_MAPLIBRE_AUTHOR "Vladimir Agafonkin" + INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/kdbush.hpp/LICENSE +) diff --git a/vendor/maplibre-native-base/extras/kdbush.hpp b/vendor/kdbush.hpp similarity index 100% rename from vendor/maplibre-native-base/extras/kdbush.hpp rename to vendor/kdbush.hpp diff --git a/vendor/maplibre-native-base.cmake b/vendor/maplibre-native-base.cmake index 633cc9269..6883bee32 100644 --- a/vendor/maplibre-native-base.cmake +++ b/vendor/maplibre-native-base.cmake @@ -2,42 +2,6 @@ if(NOT TARGET maplibre-native) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/maplibre-native-base) endif() -set_target_properties( - maplibre-native-base-extras-kdbush.hpp - PROPERTIES - INTERFACE_MAPLIBRE_NAME "kdbush.hpp" - INTERFACE_MAPLIBRE_URL "https://github.com/mourner/kdbush.hpp" - INTERFACE_MAPLIBRE_AUTHOR "Vladimir Agafonkin" - INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/maplibre-native-base/extras/kdbush.hpp/LICENSE -) - -set_target_properties( - maplibre-native-base-extras-expected-lite - PROPERTIES - INTERFACE_MAPLIBRE_NAME "expected-lite" - INTERFACE_MAPLIBRE_URL "https://github.com/martinmoene/expected-lite" - INTERFACE_MAPLIBRE_AUTHOR "Martin Moene" - INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/maplibre-native-base/extras/expected-lite/LICENSE.txt -) - -set_target_properties( - maplibre-native-base-extras-filesystem - PROPERTIES - INTERFACE_MAPLIBRE_NAME "filesystem" - INTERFACE_MAPLIBRE_URL "https://github.com/gulrak/filesystem" - INTERFACE_MAPLIBRE_AUTHOR "Steffen Schümann" - INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/maplibre-native-base/extras/filesystem/LICENSE.txt -) - -set_target_properties( - maplibre-native-base-supercluster.hpp - PROPERTIES - INTERFACE_MAPLIBRE_NAME "supercluster.hpp" - INTERFACE_MAPLIBRE_URL "https://github.com/mapbox/supercluster.hpp" - INTERFACE_MAPLIBRE_AUTHOR "Mapbox" - INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/maplibre-native-base/deps/supercluster.hpp/LICENSE -) - set_target_properties( maplibre-native-base-shelf-pack-cpp PROPERTIES @@ -56,14 +20,7 @@ set_target_properties( INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/maplibre-native-base/deps/geojson-vt-cpp/LICENSE ) -set_target_properties( - maplibre-native-base-extras-rapidjson - PROPERTIES - INTERFACE_MAPLIBRE_NAME "RapidJSON" - INTERFACE_MAPLIBRE_URL "https://rapidjson.org" - INTERFACE_MAPLIBRE_AUTHOR "THL A29 Limited, a Tencent company, and Milo Yip" - INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/maplibre-native-base/extras/rapidjson/license.txt -) + set_target_properties( maplibre-native-base-geojson.hpp diff --git a/vendor/maplibre-native-base/CMakeLists.txt b/vendor/maplibre-native-base/CMakeLists.txt index 431ac9792..80b420a2f 100644 --- a/vendor/maplibre-native-base/CMakeLists.txt +++ b/vendor/maplibre-native-base/CMakeLists.txt @@ -21,7 +21,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) -add_subdirectory(${PROJECT_SOURCE_DIR}/extras) add_subdirectory(${PROJECT_SOURCE_DIR}/include) add_subdirectory(${PROJECT_SOURCE_DIR}/deps) diff --git a/vendor/maplibre-native-base/deps/CMakeLists.txt b/vendor/maplibre-native-base/deps/CMakeLists.txt index 01de7fe3d..ceb7ebbe3 100644 --- a/vendor/maplibre-native-base/deps/CMakeLists.txt +++ b/vendor/maplibre-native-base/deps/CMakeLists.txt @@ -24,5 +24,4 @@ maplibre_native_base_add_library(geometry.hpp ${CMAKE_CURRENT_LIST_DIR}/geometry maplibre_native_base_add_library(jni.hpp ${CMAKE_CURRENT_LIST_DIR}/jni.hpp/include) maplibre_native_base_add_library(pixelmatch-cpp ${CMAKE_CURRENT_LIST_DIR}/pixelmatch-cpp/include) maplibre_native_base_add_library(shelf-pack-cpp ${CMAKE_CURRENT_LIST_DIR}/shelf-pack-cpp/include) -maplibre_native_base_add_library(supercluster.hpp ${CMAKE_CURRENT_LIST_DIR}/supercluster.hpp/include) maplibre_native_base_add_library(variant ${CMAKE_CURRENT_LIST_DIR}/variant/include) diff --git a/vendor/maplibre-native-base/extras/CMakeLists.txt b/vendor/maplibre-native-base/extras/CMakeLists.txt deleted file mode 100644 index 502a55c81..000000000 --- a/vendor/maplibre-native-base/extras/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -if(TARGET maplibre-native-base-extras) - return() -endif() - -function(maplibre_native_base_extras_add_library name include_path) - if(TARGET maplibre-native-base-extras-${name}) - return() - endif() - - add_library(maplibre-native-base-extras-${name} INTERFACE) - add_library(MapLibreNative::Base::Extras::${name} ALIAS maplibre-native-base-extras-${name}) - - target_include_directories(maplibre-native-base-extras-${name} SYSTEM INTERFACE - ${include_path} - ) - - target_link_libraries(maplibre-native-base-extras INTERFACE maplibre-native-base-extras-${name}) -endfunction() - -add_library(maplibre-native-base-extras INTERFACE) -add_library(MapLibreNative::Base::Extras ALIAS maplibre-native-base-extras) - -maplibre_native_base_extras_add_library(args ${CMAKE_CURRENT_LIST_DIR}/args) -maplibre_native_base_extras_add_library(filesystem ${CMAKE_CURRENT_LIST_DIR}/filesystem/include) -maplibre_native_base_extras_add_library(expected-lite ${CMAKE_CURRENT_LIST_DIR}/expected-lite/include) -maplibre_native_base_extras_add_library(kdbush.hpp ${CMAKE_CURRENT_LIST_DIR}/kdbush.hpp/include) - -include(${PROJECT_SOURCE_DIR}/extras/rapidjson.cmake) diff --git a/vendor/maplibre-native-base/extras/rapidjson.cmake b/vendor/maplibre-native-base/extras/rapidjson.cmake deleted file mode 100644 index a5788c87b..000000000 --- a/vendor/maplibre-native-base/extras/rapidjson.cmake +++ /dev/null @@ -1,11 +0,0 @@ -maplibre_native_base_extras_add_library(rapidjson ${CMAKE_CURRENT_LIST_DIR}/rapidjson/include) - -target_compile_definitions(maplibre-native-base-extras-rapidjson INTERFACE - RAPIDJSON_HAS_STDSTRING=1 -) - -if(WIN32) - target_compile_definitions(maplibre-native-base-extras-rapidjson INTERFACE - RAPIDJSON_HAS_CXX11_RVALUE_REFS - ) -endif() diff --git a/vendor/maplibre-native-base/include/CMakeLists.txt b/vendor/maplibre-native-base/include/CMakeLists.txt index b98014daa..bbe21de13 100644 --- a/vendor/maplibre-native-base/include/CMakeLists.txt +++ b/vendor/maplibre-native-base/include/CMakeLists.txt @@ -4,7 +4,3 @@ add_library(MapLibreNative::Base ALIAS maplibre-native-base) target_include_directories(maplibre-native-base SYSTEM INTERFACE "${PROJECT_SOURCE_DIR}/include" ) - -target_link_libraries(maplibre-native-base INTERFACE - MapLibreNative::Base::Extras::expected-lite -) diff --git a/vendor/maplibre-native-base/extras/rapidjson b/vendor/rapidjson similarity index 100% rename from vendor/maplibre-native-base/extras/rapidjson rename to vendor/rapidjson diff --git a/vendor/rapidjson.cmake b/vendor/rapidjson.cmake new file mode 100644 index 000000000..96733b3d8 --- /dev/null +++ b/vendor/rapidjson.cmake @@ -0,0 +1,29 @@ +if(TARGET mbgl-vendor-rapidjson) + return() +endif() + +add_library(mbgl-vendor-rapidjson INTERFACE) + +target_compile_definitions(mbgl-vendor-rapidjson INTERFACE + RAPIDJSON_HAS_STDSTRING=1 +) + +if(WIN32) + target_compile_definitions(mbgl-vendor-rapidjson INTERFACE + RAPIDJSON_HAS_CXX11_RVALUE_REFS + ) +endif() + +target_include_directories( + mbgl-vendor-rapidjson SYSTEM + INTERFACE ${CMAKE_CURRENT_LIST_DIR}/rapidjson/include +) + +set_target_properties( + mbgl-vendor-rapidjson + PROPERTIES + INTERFACE_MAPLIBRE_NAME "RapidJSON" + INTERFACE_MAPLIBRE_URL "https://rapidjson.org" + INTERFACE_MAPLIBRE_AUTHOR "THL A29 Limited, a Tencent company, and Milo Yip" + INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/rapidjson/license.txt +) diff --git a/vendor/maplibre-native-base/deps/supercluster.hpp b/vendor/supercluster similarity index 100% rename from vendor/maplibre-native-base/deps/supercluster.hpp rename to vendor/supercluster diff --git a/vendor/supercluster.cmake b/vendor/supercluster.cmake new file mode 100644 index 000000000..7a572480f --- /dev/null +++ b/vendor/supercluster.cmake @@ -0,0 +1,19 @@ +if(TARGET mbgl-vendor-supercluster) + return() +endif() + +add_library(mbgl-vendor-supercluster INTERFACE) + +target_include_directories( + mbgl-vendor-supercluster SYSTEM + INTERFACE ${CMAKE_CURRENT_LIST_DIR}/supercluster/include +) + +set_target_properties( + mbgl-vendor-supercluster + PROPERTIES + INTERFACE_MAPLIBRE_NAME "supercluster.hpp" + INTERFACE_MAPLIBRE_URL "https://github.com/mapbox/supercluster.hpp" + INTERFACE_MAPLIBRE_AUTHOR "Mapbox" + INTERFACE_MAPLIBRE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/supercluster/LICENSE +)