[gdal-dev] limiting drivers that get registered

Kurt Schwehr schwehr at gmail.com
Thu Mar 8 10:57:11 PST 2018


I use bazel for building, so the build info isn't useful.  You'll have to
hack the makefiles a bit.

I also tried to stop things from registering...
find . -name \*.cpp | egrep -v
'autotest|swig|apps|fuzzers|gdaldrivermanager.cpp|ogrregisterall.cpp|gdalallregister.cpp'
| xargs egrep 'Register[(][)];|OGRRegisterAll|GDALRegister' | egrep -v
'void|: +[*]|:/'


Here are my two diffs:  (note that I don't define FRMT_raw in my builds)

diff -u a/gdalallregister.cpp  b/gdalallregister.cpp
--- a/gdalallregister.cpp 2018-03-08 10:40:24.342388944 -0800
+++ b/gdalallregister.cpp 2017-12-28 10:13:13.000000000 -0800
@@ -67,7 +67,8 @@

 #ifdef FRMT_vrt
     GDALRegister_VRT();
-    GDALRegister_Derived();
+    // GDALRegister_Derived();
 #endif

 #ifdef FRMT_gtiff
@@ -220,7 +221,8 @@
 #endif

 #ifdef FRMT_netcdf
-    GDALRegister_GMT();
+    // GDALRegister_GMT();
     GDALRegister_netCDF();
 #endif

@@ -406,6 +408,11 @@
 /*      ASCII-header in the same directory.                             */
 /* -------------------------------------------------------------------- */

+    GDALRegister_EHdr();
+    GDALRegister_ENVI();
+
 #ifdef FRMT_raw
     GDALRegister_PNM();
     GDALRegister_DOQ1();
@@ -476,7 +483,8 @@
 #endif

 #ifdef FRMT_hdf5
-    GDALRegister_BAG();
+    // GDALRegister_BAG();
     GDALRegister_HDF5();
     GDALRegister_HDF5Image();
 #endif

diff -u a/ogrregisterall.cpp b/ogrregisterall.cpp
--- a/ogrregisterall.cpp 2018-03-08 10:54:56.775492742 -0800
+++ b/ogrregisterall.cpp 2018-03-08 10:54:27.643856370 -0800
@@ -106,7 +106,7 @@
     RegisterOGRGMT();
 #endif
 #ifdef SQLITE_ENABLED
-    RegisterOGRGeoPackage();
+    // RegisterOGRGeoPackage();
     RegisterOGRSQLite();
 #endif
 #ifdef DODS_ENABLED


On Thu, Mar 8, 2018 at 9:21 AM, Tobias Wendorff <
tobias.wendorff at tu-dortmund.de> wrote:

> Am Do, 8.03.2018, 17:47 schrieb Kurt Schwehr:
> > I get a little more aggressive compared to what others suggested by
> > commenting out register calls in gdalallregister.cpp and
> > ogrregisterall.cpp
> > and removing the code for the drivers.
> >
>
> Share, share, share :)
>
>


-- 
--
http://schwehr.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180308/e1d0f644/attachment-0001.html>


More information about the gdal-dev mailing list