diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-07-23 17:35:43 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-09-17 12:28:55 +0300 |
commit | 8ee6cfa8fb022a7319ce83e795f4ff0d7e747ad7 (patch) | |
tree | fa7315445fd2808c35ac852f186ca592ba56b898 | |
parent | e3421e042fe720d4d7b13457c4597921f31f3bcd (diff) | |
download | qtlocation-mapboxgl-8ee6cfa8fb022a7319ce83e795f4ff0d7e747ad7.tar.gz |
[build] Cosmetics on vendor packages
- Add include guards on all the files
- Add a vendor package for sqlite and gtest
- Use relative paths to all the files
28 files changed, 229 insertions, 133 deletions
diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index a944c64d05..7bca681f86 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -11,7 +11,7 @@ target_include_directories(mbgl-benchmark target_link_libraries(mbgl-benchmark PRIVATE mbgl-core - PRIVATE benchmark + PRIVATE mbgl-vendor-benchmark ) mbgl_platform_benchmark() diff --git a/cmake/core.cmake b/cmake/core.cmake index f08ff6bcab..342731de9f 100644 --- a/cmake/core.cmake +++ b/cmake/core.cmake @@ -8,31 +8,31 @@ target_include_directories(mbgl-core ) target_link_libraries(mbgl-core PRIVATE - earcut.hpp - eternal - expected - geojson-vt-cpp - shelf-pack-cpp - unique_resource - wagyu + mbgl-vendor-earcut.hpp + mbgl-vendor-eternal + mbgl-vendor-expected + mbgl-vendor-geojson-vt-cpp + mbgl-vendor-shelf-pack-cpp + mbgl-vendor-unique_resource + mbgl-vendor-wagyu ) # linux uses ICU from mason, other platforms use vendored ICU if(NOT MBGL_PLATFORM STREQUAL "linux") - set(ICU_LIBRARY "icu") + set(ICU_LIBRARY "mbgl-vendor-icu") endif() # FIXME: We should not leak these many # libraries in our public interface. target_link_libraries(mbgl-core PUBLIC - boost + mbgl-vendor-boost mapbox-base-extras mapbox-base ${ICU_LIBRARY} - polylabel - protozero + mbgl-vendor-polylabel + mbgl-vendor-protozero Mapbox::Base::Extras::rapidjson - vector-tile + mbgl-vendor-vector-tile ) mbgl_platform_core() diff --git a/cmake/filesource.cmake b/cmake/filesource.cmake index ff9fa360f6..4d7febdd77 100644 --- a/cmake/filesource.cmake +++ b/cmake/filesource.cmake @@ -10,7 +10,7 @@ target_include_directories(mbgl-filesource target_link_libraries(mbgl-filesource PUBLIC mbgl-core - PUBLIC expected + PUBLIC mbgl-vendor-expected ) mbgl_filesource() diff --git a/cmake/glfw.cmake b/cmake/glfw.cmake index 6abc93d837..b9ed13af28 100644 --- a/cmake/glfw.cmake +++ b/cmake/glfw.cmake @@ -22,7 +22,7 @@ target_include_directories(mbgl-glfw target_link_libraries(mbgl-glfw PRIVATE mbgl-core PRIVATE glfw - PRIVATE cheap-ruler-cpp + PRIVATE mbgl-vendor-cheap-ruler-cpp PRIVATE Mapbox::Base::Extras::args ) diff --git a/cmake/render-test.cmake b/cmake/render-test.cmake index 9bc37df808..7369655630 100644 --- a/cmake/render-test.cmake +++ b/cmake/render-test.cmake @@ -21,7 +21,7 @@ target_link_libraries(mbgl-render-test PRIVATE mbgl-core mbgl-filesource Mapbox::Base::Extras::args - expected + mbgl-vendor-expected Mapbox::Base::Extras::filesystem Mapbox::Base::pixelmatch-cpp Mapbox::Base::Extras::rapidjson diff --git a/cmake/test.cmake b/cmake/test.cmake index 3cb0ef3a72..405552423c 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -23,11 +23,11 @@ target_include_directories(mbgl-test ) target_link_libraries(mbgl-test PRIVATE - googletest + mbgl-vendor-googletest Mapbox::Base::Extras::args mbgl-core - shelf-pack-cpp - unique_resource + mbgl-vendor-shelf-pack-cpp + mbgl-vendor-unique_resource Mapbox::Base::pixelmatch-cpp ) diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake index e5386e4ae0..7f15355876 100644 --- a/platform/ios/config.cmake +++ b/platform/ios/config.cmake @@ -13,7 +13,7 @@ endmacro() include(cmake/loop-darwin.cmake) -initialize_ios_target(icu) +initialize_ios_target(mbgl-vendor-icu) initialize_ios_target(mbgl-loop-darwin) diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 7712c332c4..9ac5d564fe 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -276,8 +276,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 */; }; + 55CF752F213ED92000ED86C4 /* libmbgl-vendor-icu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF752E213ED92000ED86C4 /* libmbgl-vendor-icu.a */; }; + 55CF7531213ED92A00ED86C4 /* libmbgl-vendor-icu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF7530213ED92A00ED86C4 /* libmbgl-vendor-icu.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 */; }; @@ -1070,8 +1070,8 @@ 5580B45A229570A10091291B /* MGLMapView+OpenGL.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+OpenGL.mm"; 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; }; + 55CF752E213ED92000ED86C4 /* libmbgl-vendor-icu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libmbgl-vendor-icu.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 55CF7530213ED92A00ED86C4 /* libmbgl-vendor-icu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libmbgl-vendor-icu.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>"; }; @@ -1514,7 +1514,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 */, + 55CF752F213ED92000ED86C4 /* libmbgl-vendor-icu.a in Frameworks */, DA27C24E1CBB3811000B0ECD /* GLKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1527,7 +1527,7 @@ 9680276422655696006BA4A1 /* libmbxaccounts.a in Frameworks */, DAAE5F8920F047240089D85B /* libmbgl-filesource.a in Frameworks */, DAAE5F8A20F0472E0089D85B /* libmbgl-loop-darwin.a in Frameworks */, - 55CF7531213ED92A00ED86C4 /* libicu.a in Frameworks */, + 55CF7531213ED92A00ED86C4 /* libmbgl-vendor-icu.a in Frameworks */, 550570D22296E96E00228ECF /* GLKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2037,8 +2037,8 @@ isa = PBXGroup; children = ( 9680274122653C3E006BA4A1 /* libmbxaccounts.a */, - 55CF7530213ED92A00ED86C4 /* libicu.a */, - 55CF752E213ED92000ED86C4 /* libicu.a */, + 55CF7530213ED92A00ED86C4 /* libmbgl-vendor-icu.a */, + 55CF752E213ED92000ED86C4 /* libmbgl-vendor-icu.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 d7bfad0011..74860ea0d7 100644 --- a/platform/linux/config.cmake +++ b/platform/linux/config.cmake @@ -98,7 +98,7 @@ macro(mbgl_platform_core) PRIVATE ${LIBICUI18N} PRIVATE ${LIBICUUC} PRIVATE ${LIBICUDATA} - PRIVATE nunicode + PRIVATE mbgl-vendor-nunicode PUBLIC -lz ) endmacro() diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index d290d97012..50f592a4bc 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -98,7 +98,7 @@ 5591AC6B2298361600FF9ADF /* MGLMapView+Impl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5591AC692298361600FF9ADF /* MGLMapView+Impl.mm */; }; 55CAF6322294407F00F17770 /* MGLMapView+OpenGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 55CAF6312294407F00F17770 /* MGLMapView+OpenGL.h */; }; 55CAF6342294409B00F17770 /* MGLMapView+OpenGL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55CAF6332294409B00F17770 /* MGLMapView+OpenGL.mm */; }; - 55CF7533213EDADF00ED86C4 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF7532213EDADF00ED86C4 /* libicu.a */; }; + 55CF7533213EDADF00ED86C4 /* libmbgl-vendor-icu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF7532213EDADF00ED86C4 /* libmbgl-vendor-icu.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 */; }; @@ -424,7 +424,7 @@ 5591AC692298361600FF9ADF /* MGLMapView+Impl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+Impl.mm"; sourceTree = "<group>"; }; 55CAF6312294407F00F17770 /* MGLMapView+OpenGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MGLMapView+OpenGL.h"; sourceTree = "<group>"; }; 55CAF6332294409B00F17770 /* MGLMapView+OpenGL.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+OpenGL.mm"; sourceTree = "<group>"; }; - 55CF7532213EDADF00ED86C4 /* libicu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libicu.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 55CF7532213EDADF00ED86C4 /* libmbgl-vendor-icu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libmbgl-vendor-icu.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>"; }; @@ -740,7 +740,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 */, + 55CF7533213EDADF00ED86C4 /* libmbgl-vendor-icu.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1146,7 +1146,7 @@ DAE6C31E1CC308BC00DB3429 /* Frameworks */ = { isa = PBXGroup; children = ( - 55CF7532213EDADF00ED86C4 /* libicu.a */, + 55CF7532213EDADF00ED86C4 /* libmbgl-vendor-icu.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 9249f846e8..b4a486b08b 100644 --- a/platform/qt/config.cmake +++ b/platform/qt/config.cmake @@ -13,7 +13,7 @@ macro(mbgl_platform_core) target_link_libraries(mbgl-core PRIVATE ${MBGL_QT_CORE_LIBRARIES} - nunicode + mbgl-vendor-nunicode ) if(NOT WITH_QT_DECODERS) @@ -30,7 +30,7 @@ macro(mbgl_platform_core) if(NOT WITH_QT_I18N) target_sources(mbgl-core PRIVATE platform/default/src/mbgl/text/bidi.cpp) - target_link_libraries(mbgl-core PRIVATE icu) + target_link_libraries(mbgl-core PRIVATE mbgl-vendor-icu) else() target_sources(mbgl-core PRIVATE platform/qt/src/bidi.cpp) endif() diff --git a/vendor/benchmark.cmake b/vendor/benchmark.cmake index 516e3cd333..44c0672971 100644 --- a/vendor/benchmark.cmake +++ b/vendor/benchmark.cmake @@ -1,25 +1,31 @@ -add_library(benchmark STATIC - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/commandlineflags.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/console_reporter.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/complexity.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/csv_reporter.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/colorprint.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/sleep.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/benchmark.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/counter.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/benchmark_register.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/statistics.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/json_reporter.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/reporter.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/string_util.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/sysinfo.cc - ${CMAKE_SOURCE_DIR}/vendor/benchmark/src/timers.cc +if(TARGET mbgl-vendor-benchmark) + return() +endif() + +add_library(mbgl-vendor-benchmark STATIC EXCLUDE_FROM_ALL + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/commandlineflags.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/console_reporter.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/complexity.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/csv_reporter.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/colorprint.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/sleep.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/benchmark.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/counter.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/benchmark_register.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/statistics.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/json_reporter.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/reporter.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/string_util.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/sysinfo.cc + ${CMAKE_CURRENT_LIST_DIR}/benchmark/src/timers.cc ) -target_compile_definitions(benchmark PRIVATE +target_compile_definitions(mbgl-vendor-benchmark PRIVATE HAVE_STEADY_CLOCK ) -target_include_directories(benchmark SYSTEM PUBLIC - ${CMAKE_SOURCE_DIR}/vendor/benchmark/include +target_include_directories(mbgl-vendor-benchmark SYSTEM PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/benchmark/include ) + +set_property(TARGET mbgl-vendor-benchmark PROPERTY FOLDER Core) diff --git a/vendor/boost.cmake b/vendor/boost.cmake index 7c30a8d90e..33b203368e 100644 --- a/vendor/boost.cmake +++ b/vendor/boost.cmake @@ -1,5 +1,9 @@ -add_library(boost INTERFACE) +if(TARGET mbgl-vendor-boost) + return() +endif() -target_include_directories(boost SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/boost/include +add_library(mbgl-vendor-boost INTERFACE) + +target_include_directories(mbgl-vendor-boost SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/boost/include ) diff --git a/vendor/cheap-ruler-cpp.cmake b/vendor/cheap-ruler-cpp.cmake index 8d98cde63c..741a7b2ec2 100644 --- a/vendor/cheap-ruler-cpp.cmake +++ b/vendor/cheap-ruler-cpp.cmake @@ -1,6 +1,10 @@ -add_library(cheap-ruler-cpp INTERFACE) +if(TARGET mbgl-vendor-cheap-ruler-cpp) + return() +endif() -target_include_directories(cheap-ruler-cpp SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/cheap-ruler-cpp/include +add_library(mbgl-vendor-cheap-ruler-cpp INTERFACE) + +target_include_directories(mbgl-vendor-cheap-ruler-cpp SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/cheap-ruler-cpp/include ) diff --git a/vendor/earcut.hpp.cmake b/vendor/earcut.hpp.cmake index d7992cda50..e5459f16ce 100644 --- a/vendor/earcut.hpp.cmake +++ b/vendor/earcut.hpp.cmake @@ -1,5 +1,9 @@ -add_library(earcut.hpp INTERFACE) +if(TARGET mbgl-vendor-earcut.hpp) + return() +endif() -target_include_directories(earcut.hpp SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/earcut.hpp/include +add_library(mbgl-vendor-earcut.hpp INTERFACE) + +target_include_directories(mbgl-vendor-earcut.hpp SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/earcut.hpp/include ) diff --git a/vendor/eternal.cmake b/vendor/eternal.cmake index 1239a8a43d..5a429db4fa 100644 --- a/vendor/eternal.cmake +++ b/vendor/eternal.cmake @@ -1,5 +1,9 @@ -add_library(eternal INTERFACE) +if(TARGET mbgl-vendor-eternal) + return() +endif() -target_include_directories(eternal SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/eternal/include +add_library(mbgl-vendor-eternal INTERFACE) + +target_include_directories(mbgl-vendor-eternal SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/eternal/include ) diff --git a/vendor/expected.cmake b/vendor/expected.cmake index ebe63e1a10..f87f057386 100644 --- a/vendor/expected.cmake +++ b/vendor/expected.cmake @@ -1,5 +1,9 @@ -add_library(expected INTERFACE) +if(TARGET mbgl-vendor-expected) + return() +endif() -target_include_directories(expected SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/expected/include +add_library(mbgl-vendor-expected INTERFACE) + +target_include_directories(mbgl-vendor-expected SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/expected/include ) diff --git a/vendor/geojson-vt-cpp.cmake b/vendor/geojson-vt-cpp.cmake index c8d955f64b..f2646336b3 100644 --- a/vendor/geojson-vt-cpp.cmake +++ b/vendor/geojson-vt-cpp.cmake @@ -1,5 +1,9 @@ -add_library(geojson-vt-cpp INTERFACE) +if(TARGET mbgl-vendor-geojson-vt-cpp) + return() +endif() -target_include_directories(geojson-vt-cpp SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/geojson-vt-cpp/include +add_library(mbgl-vendor-geojson-vt-cpp INTERFACE) + +target_include_directories(mbgl-vendor-geojson-vt-cpp SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/geojson-vt-cpp/include ) diff --git a/vendor/googletest.cmake b/vendor/googletest.cmake index edf8ebd82e..4ae0afddb5 100644 --- a/vendor/googletest.cmake +++ b/vendor/googletest.cmake @@ -1,16 +1,22 @@ -add_library(googletest STATIC - ${CMAKE_SOURCE_DIR}/vendor/googletest/googletest/src/gtest-all.cc - ${CMAKE_SOURCE_DIR}/vendor/googletest/googlemock/src/gmock-all.cc +if(TARGET mbgl-vendor-googletest) + return() +endif() + +add_library(mbgl-vendor-googletest STATIC EXCLUDE_FROM_ALL + ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/src/gtest-all.cc + ${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock/src/gmock-all.cc ) -target_include_directories(googletest PRIVATE - ${CMAKE_SOURCE_DIR}/vendor/googletest/googletest - ${CMAKE_SOURCE_DIR}/vendor/googletest/googletest/include - ${CMAKE_SOURCE_DIR}/vendor/googletest/googlemock - ${CMAKE_SOURCE_DIR}/vendor/googletest/googlemock/include +target_include_directories(mbgl-vendor-googletest PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest + ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include + ${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock + ${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock/include ) -target_include_directories(googletest SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/googletest/googletest/include - ${CMAKE_SOURCE_DIR}/vendor/googletest/googlemock/include +target_include_directories(mbgl-vendor-googletest SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include + ${CMAKE_CURRENT_LIST_DIR}/googletest/googlemock/include ) + +set_property(TARGET mbgl-vendor-googletest PROPERTY FOLDER Core) diff --git a/vendor/icu.cmake b/vendor/icu.cmake index 419b78333a..c3a05fe44b 100644 --- a/vendor/icu.cmake +++ b/vendor/icu.cmake @@ -1,22 +1,26 @@ -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 +if(TARGET mbgl-vendor-icu) + return() +endif() + +add_library(mbgl-vendor-icu STATIC + ${CMAKE_CURRENT_LIST_DIR}/icu/src/cmemory.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/cstring.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/ubidi.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/ubidi_props.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/ubidiln.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/ubidiwrt.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/uchar.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/udataswp.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/uinvchar.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/umath.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/ushape.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/ustring.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/utf_impl.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/utrie2.cpp + ${CMAKE_CURRENT_LIST_DIR}/icu/src/utypes.cpp ) -target_compile_definitions(icu PRIVATE +target_compile_definitions(mbgl-vendor-icu PRIVATE UCONFIG_NO_BREAK_ITERATION=1 UCONFIG_NO_LEGACY_CONVERSION=1 U_CHARSET_IS_UTF8=1 @@ -26,11 +30,13 @@ target_compile_definitions(icu PRIVATE _REENTRANT ) -target_compile_options(icu PRIVATE +target_compile_options(mbgl-vendor-icu PRIVATE -Wno-error -Wno-shorten-64-to-32 ) -target_include_directories(icu SYSTEM PUBLIC - ${CMAKE_SOURCE_DIR}/vendor/icu/include +target_include_directories(mbgl-vendor-icu SYSTEM PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/icu/include ) + +set_property(TARGET mbgl-vendor-icu PROPERTY FOLDER Core) diff --git a/vendor/nunicode.cmake b/vendor/nunicode.cmake index d318b8a265..0a310a7bea 100644 --- a/vendor/nunicode.cmake +++ b/vendor/nunicode.cmake @@ -1,21 +1,25 @@ -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 +if(TARGET mbgl-vendor-nunicode) + return() +endif() + +add_library(mbgl-vendor-nunicode STATIC + ${CMAKE_CURRENT_LIST_DIR}/nunicode/src/libnu/ducet.c + ${CMAKE_CURRENT_LIST_DIR}/nunicode/src/libnu/strcoll.c + ${CMAKE_CURRENT_LIST_DIR}/nunicode/src/libnu/strings.c + ${CMAKE_CURRENT_LIST_DIR}/nunicode/src/libnu/tolower.c + ${CMAKE_CURRENT_LIST_DIR}/nunicode/src/libnu/tounaccent.c + ${CMAKE_CURRENT_LIST_DIR}/nunicode/src/libnu/toupper.c + ${CMAKE_CURRENT_LIST_DIR}/nunicode/src/libnu/utf8.c ) -target_compile_definitions(nunicode PRIVATE +target_compile_definitions(mbgl-vendor-nunicode PRIVATE NU_BUILD_STATIC ) -target_compile_options(nunicode PRIVATE +target_compile_options(mbgl-vendor-nunicode PRIVATE -Wno-error ) -target_include_directories(nunicode SYSTEM PUBLIC - ${CMAKE_SOURCE_DIR}/vendor/nunicode/include +target_include_directories(mbgl-vendor-nunicode SYSTEM PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/nunicode/include ) diff --git a/vendor/polylabel.cmake b/vendor/polylabel.cmake index d732723a89..5a930c9f6d 100644 --- a/vendor/polylabel.cmake +++ b/vendor/polylabel.cmake @@ -1,5 +1,9 @@ -add_library(polylabel INTERFACE) +if(TARGET mbgl-vendor-polylabel) + return() +endif() -target_include_directories(polylabel SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/polylabel/include +add_library(mbgl-vendor-polylabel INTERFACE) + +target_include_directories(mbgl-vendor-polylabel SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/polylabel/include ) diff --git a/vendor/protozero.cmake b/vendor/protozero.cmake index e4f32f1ace..41af37f188 100644 --- a/vendor/protozero.cmake +++ b/vendor/protozero.cmake @@ -1,5 +1,9 @@ -add_library(protozero INTERFACE) +if(TARGET mbgl-vendor-protozero) + return() +endif() -target_include_directories(protozero SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/protozero/include +add_library(mbgl-vendor-protozero INTERFACE) + +target_include_directories(mbgl-vendor-protozero SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/protozero/include ) diff --git a/vendor/shelf-pack-cpp.cmake b/vendor/shelf-pack-cpp.cmake index 0d8e850723..bf2e07c22f 100644 --- a/vendor/shelf-pack-cpp.cmake +++ b/vendor/shelf-pack-cpp.cmake @@ -1,5 +1,9 @@ -add_library(shelf-pack-cpp INTERFACE) +if(TARGET mbgl-vendor-shelf-pack-cpp) + return() +endif() -target_include_directories(shelf-pack-cpp SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/shelf-pack-cpp/include +add_library(mbgl-vendor-shelf-pack-cpp INTERFACE) + +target_include_directories(mbgl-vendor-shelf-pack-cpp SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/shelf-pack-cpp/include ) diff --git a/vendor/sqlite.cmake b/vendor/sqlite.cmake new file mode 100644 index 0000000000..d01ac0dd4e --- /dev/null +++ b/vendor/sqlite.cmake @@ -0,0 +1,26 @@ +if(TARGET mbgl-vendor-sqlite) + return() +endif() + +add_library(mbgl-vendor-sqlite STATIC + ${CMAKE_CURRENT_LIST_DIR}/sqlite/src/sqlite3.c +) + +include(CheckSymbolExists) +check_symbol_exists("strerror_r" "string.h" MBGL_SQLITE3_HAVE_STRERROR_R) + +if(MBGL_SQLITE3_HAVE_STRERROR_R) + target_compile_definitions(mbgl-vendor-sqlite PRIVATE + HAVE_STRERROR_R + ) +endif() + +# So we don't need to link with -ldl +target_compile_definitions(mbgl-vendor-sqlite PRIVATE + SQLITE_OMIT_LOAD_EXTENSION + SQLITE_THREADSAFE +) + +target_include_directories(mbgl-vendor-sqlite SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/sqlite/include +) diff --git a/vendor/unique_resource.cmake b/vendor/unique_resource.cmake index ad450066eb..02fed9cbc1 100644 --- a/vendor/unique_resource.cmake +++ b/vendor/unique_resource.cmake @@ -1,5 +1,9 @@ -add_library(unique_resource INTERFACE) +if(TARGET mbgl-vendor-unique_resource) + return() +endif() -target_include_directories(unique_resource SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/unique_resource +add_library(mbgl-vendor-unique_resource INTERFACE) + +target_include_directories(mbgl-vendor-unique_resource SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/unique_resource ) diff --git a/vendor/vector-tile.cmake b/vendor/vector-tile.cmake index ec4552afcc..5f31fae94c 100644 --- a/vendor/vector-tile.cmake +++ b/vendor/vector-tile.cmake @@ -1,5 +1,9 @@ -add_library(vector-tile INTERFACE) +if(TARGET mbgl-vendor-vector-tile) + return() +endif() -target_include_directories(vector-tile SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/vector-tile/include +add_library(mbgl-vendor-vector-tile INTERFACE) + +target_include_directories(mbgl-vendor-vector-tile SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/vector-tile/include ) diff --git a/vendor/wagyu.cmake b/vendor/wagyu.cmake index 7cf3397b89..15f0758fb8 100644 --- a/vendor/wagyu.cmake +++ b/vendor/wagyu.cmake @@ -1,5 +1,9 @@ -add_library(wagyu INTERFACE) +if(TARGET mbgl-vendor-wagyu) + return() +endif() -target_include_directories(wagyu SYSTEM INTERFACE - ${CMAKE_SOURCE_DIR}/vendor/wagyu/include +add_library(mbgl-vendor-wagyu INTERFACE) + +target_include_directories(mbgl-vendor-wagyu SYSTEM INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/wagyu/include ) |