Skip to content

Commit

Permalink
Drop PersistentCacheTileDataSource from 'lite' profile, reorganize an…
Browse files Browse the repository at this point in the history
…d clean up profile related configuration
  • Loading branch information
mtehver committed Jan 10, 2022
1 parent e948512 commit 953a2da
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 9 deletions.
3 changes: 3 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ which are defined in 'scripts/build/sdk_profiles.json' file. Different profiles
example the official SDK builds are currently compiled with 'valhalla+nmlmodellodtree' profiles. The
following instructions use 'standard' profile as an example.

In order to make SDK binaries as small as possible, 'lite' profile can be used. This profile disables
geocoding, routing and offline support, but resulting binaries are about 40% smaller.

## Building process
Be patient - full build will take 1+ hours. You can speed it up by limiting architectures and platforms where it is built.

Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ CARTO Mobile SDK 4.4.4
* Fixed issues with 'feature id' handling in vector tile renderer when feature was used in multiple layers
* Updated harfbuzz dependency to the latest stable version
* Fixed wrong compilation profile used for UWP builds, resulting in missing a few features
* Dropped 'PersistentCacheTileDataSource' from 'lite' compilation profile, making 'lite' SDK build smaller
* Minor fixes related to non-standard SDK profiles
* Minor optimizations


Expand Down
4 changes: 4 additions & 0 deletions all/modules/core/Address.i
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

%module Address

#ifdef _CARTO_GEOCODING_SUPPORT

!proxy_imports(carto::Address, core.StringVector)

%{
Expand Down Expand Up @@ -35,3 +37,5 @@
%include "core/Address.h"

#endif

#endif
4 changes: 4 additions & 0 deletions all/modules/datasources/PersistentCacheTileDataSource.i
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

%module(directors="1") PersistentCacheTileDataSource

#ifdef _CARTO_OFFLINE_SUPPORT

!proxy_imports(carto::PersistentCacheTileDataSource, core.MapBounds, core.MapTile, core.MapBounds, core.StringMap, datasources.CacheTileDataSource, datasources.TileDownloadListener, datasources.components.TileData)

%{
Expand Down Expand Up @@ -30,3 +32,5 @@
%include "datasources/PersistentCacheTileDataSource.h"

#endif

#endif
4 changes: 4 additions & 0 deletions all/modules/geocoding/GeocodingAddress.i
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

%module GeocodingAddress

#ifdef _CARTO_GEOCODING_SUPPORT

!proxy_imports(carto::GeocodingAddress, core.Address, core.StringVector)

%{
Expand All @@ -24,3 +26,5 @@
%include "geocoding/GeocodingAddress.h"

#endif

#endif
4 changes: 4 additions & 0 deletions all/native/core/Address.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef _CARTO_GEOCODING_SUPPORT

#include "Address.h"

#include <sstream>
Expand Down Expand Up @@ -119,3 +121,5 @@ namespace carto {
}

}

#endif
4 changes: 4 additions & 0 deletions all/native/core/Address.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef _CARTO_ADDRESS_H_
#define _CARTO_ADDRESS_H_

#ifdef _CARTO_GEOCODING_SUPPORT

#include <string>
#include <vector>

Expand Down Expand Up @@ -140,3 +142,5 @@ namespace carto {
}

#endif

#endif
4 changes: 4 additions & 0 deletions all/native/datasources/PersistentCacheTileDataSource.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef _CARTO_OFFLINE_SUPPORT

#include "PersistentCacheTileDataSource.h"
#include "core/BinaryData.h"
#include "datasources/TileDownloadListener.h"
Expand Down Expand Up @@ -408,3 +410,5 @@ namespace carto {
const unsigned int PersistentCacheTileDataSource::EXTRA_TILE_FOOTPRINT = 1024;

}

#endif
4 changes: 4 additions & 0 deletions all/native/datasources/PersistentCacheTileDataSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef _CARTO_PERSISTENTCACHETILEDATASOURCE_H_
#define _CARTO_PERSISTENTCACHETILEDATASOURCE_H_

#ifdef _CARTO_OFFLINE_SUPPORT

#include "core/MapBounds.h"
#include "components/CancelableThreadPool.h"
#include "components/DirectorPtr.h"
Expand Down Expand Up @@ -135,3 +137,5 @@ namespace carto {
}

#endif

#endif
4 changes: 4 additions & 0 deletions all/native/geocoding/GeocodingAddress.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef _CARTO_GEOCODING_SUPPORT

#include "GeocodingAddress.h"

namespace carto {
Expand All @@ -16,3 +18,5 @@ namespace carto {
}

}

#endif
4 changes: 4 additions & 0 deletions all/native/geocoding/GeocodingAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef _CARTO_GEOCODINGADDRESS_H_
#define _CARTO_GEOCODINGADDRESS_H_

#ifdef _CARTO_GEOCODING_SUPPORT

#include "core/Address.h"

namespace carto {
Expand Down Expand Up @@ -40,3 +42,5 @@ namespace carto {
}

#endif

#endif
4 changes: 3 additions & 1 deletion ios/objc/CartoMobileSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#import "NTOptions.h"
#import "NTLayers.h"

#ifdef _CARTO_GEOCODING_SUPPORT
#import "NTAddress.h"
#endif
#import "NTMapBounds.h"
#import "NTMapEnvelope.h"
#import "NTMapPos.h"
Expand All @@ -32,7 +34,6 @@
#import "NTGeoJSONVectorTileDataSource.h"
#import "NTHTTPTileDataSource.h"
#import "NTMemoryCacheTileDataSource.h"
#import "NTPersistentCacheTileDataSource.h"
#import "NTCartoOnlineTileDataSource.h"
#import "NTMapTilerOnlineTileDataSource.h"
#import "NTLocalVectorDataSource.h"
Expand Down Expand Up @@ -157,6 +158,7 @@

#ifdef _CARTO_OFFLINE_SUPPORT
#import "NTMBTilesTileDataSource.h"
#import "NTPersistentCacheTileDataSource.h"
#endif

#ifdef _CARTO_PACKAGEMANAGER_SUPPORT
Expand Down
16 changes: 14 additions & 2 deletions scripts/build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ if(WIN32)
endif(WIN32)

# Subprojects
set(SDK_CARTO_SUBPROJECTS vt mapnikvt mbvtbuilder cartocss nml osrm sgre geocoding)
set(SDK_EXTERNAL_SUBPROJECTS botan pugixml sqlite sqlite3pp bidi freetype harfbuzz brotli miniz libjpeg libpng libwebp tess2 pvrt rg_etc1)
set(SDK_CARTO_SUBPROJECTS vt mapnikvt mbvtbuilder cartocss nml)
set(SDK_EXTERNAL_SUBPROJECTS botan pugixml bidi freetype harfbuzz brotli miniz libjpeg libpng libwebp tess2 pvrt rg_etc1)

if(WIN32)
list(APPEND SDK_EXTERNAL_SUBPROJECTS "zlib")
Expand All @@ -120,6 +120,18 @@ if(NOT (WIN32 OR APPLE OR ANDROID))
list(APPEND SDK_EXTERNAL_SUBPROJECTS "pion")
endif()

if(INCLUDE_GEOCODING)
list(APPEND SDK_CARTO_SUBPROJECTS "geocoding")
endif(INCLUDE_GEOCODING)

if(INCLUDE_ROUTING)
list(APPEND SDK_CARTO_SUBPROJECTS "osrm" "sgre")
endif(INCLUDE_ROUTING)

if(INCLUDE_SQLITE)
list(APPEND SDK_EXTERNAL_SUBPROJECTS "sqlite" "sqlite3pp")
endif(INCLUDE_SQLITE)

if(INCLUDE_VALHALLA)
list(APPEND SDK_EXTERNAL_SUBPROJECTS "date" "protobuf" "valhalla")
endif(INCLUDE_VALHALLA)
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/sdk_build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def getProfile(profileIds):
defines = set()
cmakeOptions = set()
allProfileIds = profileIds.split('+')
if 'lite' not in profileIds:
if 'lite' not in allProfileIds:
allProfileIds.append(getDefaultProfileId())
for profileId in allProfileIds:
profile = getProfiles()[profileId]
Expand Down
6 changes: 1 addition & 5 deletions scripts/build/sdk_profiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},

"standard": {
"cmake-options": "INCLUDE_SQLITE:BOOL=ON;INCLUDE_ROUTING:BOOL=ON;INCLUDE_GEOCODING:BOOL=ON",
"defines": "_CARTO_SERVICES_SUPPORT;_CARTO_SEARCH_SUPPORT;_CARTO_GEOCODING_SUPPORT;_CARTO_ROUTING_SUPPORT;_CARTO_OFFLINE_SUPPORT;_CARTO_PACKAGEMANAGER_SUPPORT;_CARTO_LICENSEMANAGER_SUPPORT;_CARTO_EDITABLE_SUPPORT;_CARTO_WKBT_SUPPORT"
},

Expand All @@ -14,10 +15,5 @@

"nmlmodellodtree": {
"defines": "_CARTO_NMLMODELLODTREE_SUPPORT"
},

"gisextensions": {
"cmake-options": "INCLUDE_GDAL:BOOL=ON",
"defines": "_CARTO_GDAL_SUPPORT"
}
}

0 comments on commit 953a2da

Please sign in to comment.