Skip to content

Commit

Permalink
[build] Cosmetics on vendor packages
Browse files Browse the repository at this point in the history
- Add include guards on all the files
- Add a vendor package for sqlite and gtest
- Use relative paths to all the files
  • Loading branch information
tmpsantos committed Sep 17, 2019
1 parent e3421e0 commit 8ee6cfa
Show file tree
Hide file tree
Showing 28 changed files with 229 additions and 133 deletions.
2 changes: 1 addition & 1 deletion cmake/benchmark.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
24 changes: 12 additions & 12 deletions cmake/core.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion cmake/filesource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion cmake/glfw.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion cmake/render-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
16 changes: 8 additions & 8 deletions platform/ios/ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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>"; };
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 */,
Expand Down
2 changes: 1 addition & 1 deletion platform/linux/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ macro(mbgl_platform_core)
PRIVATE ${LIBICUI18N}
PRIVATE ${LIBICUUC}
PRIVATE ${LIBICUDATA}
PRIVATE nunicode
PRIVATE mbgl-vendor-nunicode
PUBLIC -lz
)
endmacro()
Expand Down
8 changes: 4 additions & 4 deletions platform/macos/macos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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>"; };
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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 */,
Expand Down
4 changes: 2 additions & 2 deletions platform/qt/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
44 changes: 25 additions & 19 deletions vendor/benchmark.cmake
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 7 additions & 3 deletions vendor/boost.cmake
Original file line number Diff line number Diff line change
@@ -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
)
10 changes: 7 additions & 3 deletions vendor/cheap-ruler-cpp.cmake
Original file line number Diff line number Diff line change
@@ -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
)

10 changes: 7 additions & 3 deletions vendor/earcut.hpp.cmake
Original file line number Diff line number Diff line change
@@ -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
)
10 changes: 7 additions & 3 deletions vendor/eternal.cmake
Original file line number Diff line number Diff line change
@@ -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
)
10 changes: 7 additions & 3 deletions vendor/expected.cmake
Original file line number Diff line number Diff line change
@@ -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
)
10 changes: 7 additions & 3 deletions vendor/geojson-vt-cpp.cmake
Original file line number Diff line number Diff line change
@@ -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
)
28 changes: 17 additions & 11 deletions vendor/googletest.cmake
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit 8ee6cfa

Please sign in to comment.