mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Required changed resolved
This commit is contained in:
parent
2b8a1be547
commit
a84fbbac62
|
@ -22,7 +22,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
find_package(PNG REQUIRED)
|
find_package(PNG REQUIRED)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(libpcre REQUIRED IMPORTED_TARGET libpcre)
|
pkg_check_modules(libpcre REQUIRED IMPORTED_TARGET libpcre)
|
||||||
#pkg_check_modules(libproj REQUIRED IMPORTED_TARGET libproj)
|
pkg_check_modules(proj REQUIRED IMPORTED_TARGET proj)
|
||||||
|
|
||||||
set(SAPI_ROOT "${PROJECT_SOURCE_DIR}/../.." CACHE PATH "Path to the Sandboxed API source tree")
|
set(SAPI_ROOT "${PROJECT_SOURCE_DIR}/../.." CACHE PATH "Path to the Sandboxed API source tree")
|
||||||
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
|
# cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root
|
||||||
|
@ -40,17 +40,15 @@ set_property(TARGET libgdal PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_D
|
||||||
target_link_libraries(libgdal INTERFACE
|
target_link_libraries(libgdal INTERFACE
|
||||||
crypto expat jpeg
|
crypto expat jpeg
|
||||||
PkgConfig::libpcre
|
PkgConfig::libpcre
|
||||||
/usr/lib/libproj.so
|
PkgConfig::proj
|
||||||
sqlite3 tiff z pthread m rt dl curl
|
sqlite3 tiff z pthread m rt dl curl
|
||||||
PNG::PNG)
|
PNG::PNG)
|
||||||
|
|
||||||
add_sapi_library(gdal_sapi
|
add_sapi_library(gdal_sapi
|
||||||
FUNCTIONS GDALOpen GDALAllRegister GDALGetDatasetDriver
|
FUNCTIONS GDALOpen GDALAllRegister GDALGetDatasetDriver
|
||||||
GDALGetDriverShortName GDALGetDriverLongName GDALGetRasterXSize
|
GDALGetDriverShortName GDALGetDriverLongName
|
||||||
GDALGetRasterYSize GDALGetRasterCount GDALGetProjectionRef
|
GDALGetGeoTransform GDALGetRasterBand GDALGetBlockSize
|
||||||
GDALOpenEx GDALGetGeoTransform GDALGetRasterBand GDALGetBlockSize
|
GDALGetRasterBandXSize GDALGetRasterBandYSize GDALRasterIO
|
||||||
GDALGetRasterMinimum GDALGetRasterMaximum GDALGetRasterBandXSize
|
|
||||||
GDALGetRasterBandYSize GDALRasterIO
|
|
||||||
|
|
||||||
INPUTS "/usr/include/gdal/gdal.h"
|
INPUTS "/usr/include/gdal/gdal.h"
|
||||||
LIBRARY libgdal
|
LIBRARY libgdal
|
||||||
|
|
|
@ -20,6 +20,12 @@ PNG: `sudo apt-get install libpng-dev`
|
||||||
PCRE: `sudo apt-get install libpcre3 libpcre3-dev`
|
PCRE: `sudo apt-get install libpcre3 libpcre3-dev`
|
||||||
|
|
||||||
PROJ: `sudo apt-get install libproj-dev`
|
PROJ: `sudo apt-get install libproj-dev`
|
||||||
|
|
||||||
|
OBS! You may need to set `export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib`.
|
||||||
|
It is required for libproj.so to be found into
|
||||||
|
/usr/local/lib/. You can also fix this by typing `locate libproj.so`
|
||||||
|
which will give you <the_absolute_path_of_libproj.so> and then
|
||||||
|
`cp <the_absolute_path_of_libproj.so> /usr/local/lib/`.
|
||||||
|
|
||||||
### Initializing GDAL submodule:
|
### Initializing GDAL submodule:
|
||||||
`git submodule add https://github.com/OSGeo/gdal/tree/master/gdal`
|
`git submodule add https://github.com/OSGeo/gdal/tree/master/gdal`
|
||||||
|
@ -33,7 +39,7 @@ GNUmakefile from gdal/gdal can handle building the static library.
|
||||||
|
|
||||||
`cp gdal/gdal/libgdal.a lib/`
|
`cp gdal/gdal/libgdal.a lib/`
|
||||||
|
|
||||||
OBS: The file is huge! It may take a while.
|
OBS! The file is huge! It may take a while.
|
||||||
|
|
||||||
### For testing:
|
### For testing:
|
||||||
`mkdir build && cd build`
|
`mkdir build && cd build`
|
||||||
|
@ -54,7 +60,7 @@ using GDAL functionalities and sandboxed methods.
|
||||||
|
|
||||||
*Sandboxing...*
|
*Sandboxing...*
|
||||||
|
|
||||||
The purpose of sandboxing is to limit the permissions
|
The purpose of sandboxing is to limit the permissions
|
||||||
and capabilities of library’s methods, in order to
|
and capabilities of library’s methods, in order to
|
||||||
secure the usage of them. After obtaining the sandbox,
|
secure the usage of them. After obtaining the sandbox,
|
||||||
the functions will be called through an Sandbox API
|
the functions will be called through an Sandbox API
|
||||||
|
@ -64,10 +70,10 @@ using GDAL functionalities and sandboxed methods.
|
||||||
|
|
||||||
*Raster process...*
|
*Raster process...*
|
||||||
|
|
||||||
From gdal.h header useful methods are added to sapi
|
From gdal.h header useful methods are added to sapi
|
||||||
library builded with CMake.
|
library builded with CMake.
|
||||||
|
|
||||||
One .tiff file is manipulated with GDALOpen
|
One .tiff file is manipulated with GDALOpen
|
||||||
functionality, which extracts a pointer to the data set
|
functionality, which extracts a pointer to the data set
|
||||||
containg a list of raster bands, all pertaining to the
|
containg a list of raster bands, all pertaining to the
|
||||||
same area.
|
same area.
|
||||||
|
@ -75,7 +81,7 @@ using GDAL functionalities and sandboxed methods.
|
||||||
transform, size of raster and various other information
|
transform, size of raster and various other information
|
||||||
are kept into the data set that corresponds to the image.
|
are kept into the data set that corresponds to the image.
|
||||||
|
|
||||||
To create an array containing the image information, the
|
To create an array containing the image information, the
|
||||||
dimentions needed are extracted using some specific
|
dimentions needed are extracted using some specific
|
||||||
GDAL(X/Y)Size functions applied to the block.
|
GDAL(X/Y)Size functions applied to the block.
|
||||||
GDALRasterBand function takes care of data type conversion, one more step following: placing the
|
GDALRasterBand function takes care of data type conversion, one more step following: placing the
|
||||||
|
|
Loading…
Reference in New Issue
Block a user