Skip to content

Commit 6a5935d

Browse files
committed
Fix compilation and warning problems when disabling libxml2 and/or OGR
1 parent 68be3a0 commit 6a5935d

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,14 @@ if( USE_WCS_SVR AND NOT USE_LIBXML2 )
677677
message(WARNING "WCS 1.1 and 2.0 require libxml2 support but it was not found. WCS 1.1 and 2.0 will not be supported by this build")
678678
endif( USE_WCS_SVR AND NOT USE_LIBXML2 )
679679
if( USE_WFS_SVR AND NOT USE_LIBXML2 )
680-
message(WARNING "WFS 1.1 requires libxml2 support but it was not found. WFS 1.1 will not be supported by this build")
680+
message(WARNING "WFS 1.1 and 2.0 require libxml2 support but it was not found. WFS 1.1 and 2.0 will not be supported by this build")
681681
endif( USE_WFS_SVR AND NOT USE_LIBXML2 )
682682

683683
if(WITH_SOS)
684+
if(NOT USE_OGR)
685+
report_dependency_error(WITH_SOS OGR)
686+
endif(NOT USE_OGR)
687+
684688
if(USE_PROJ AND USE_LIBXML2)
685689
set(USE_SOS_SVR 1)
686690
else(USE_PROJ AND USE_LIBXML2)

mapowscommon.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#include<libxml/parser.h>
3636
#include<libxml/tree.h>
3737

38+
#endif
39+
3840
/* W3C namespaces */
3941

4042
#define MS_OWSCOMMON_W3C_XLINK_NAMESPACE_URI "http://www.w3.org/1999/xlink"
@@ -133,6 +135,9 @@
133135
#define MS_DEFAULT_NAMESPACE_PREFIX "ms"
134136
#define MS_DEFAULT_NAMESPACE_URI "http://mapserver.gis.umn.edu/mapserver"
135137

138+
139+
#ifdef USE_LIBXML2
140+
136141
/* function prototypes */
137142

138143

mapwcs11.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ int msWCSDescribeCoverage11(mapObj *map, wcsParamsObj *params,
13491349
{
13501350
msSetError( MS_WCSERR,
13511351
"WCS 1.1 request made, but mapserver requires libxml2 for WCS 1.1 services and this is not configured.",
1352-
"msWCSDescribeCoverage11()", "NoApplicableCode" );
1352+
"msWCSDescribeCoverage11()" );
13531353
return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
13541354
}
13551355

@@ -1360,7 +1360,7 @@ int msWCSGetCapabilities11(mapObj *map, wcsParamsObj *params,
13601360
{
13611361
msSetError( MS_WCSERR,
13621362
"WCS 1.1 request made, but mapserver requires libxml2 for WCS 1.1 services and this is not configured.",
1363-
"msWCSGetCapabilities11()", "NoApplicableCode" );
1363+
"msWCSGetCapabilities11()" );
13641364

13651365
return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
13661366
}

mapwfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4139,6 +4139,7 @@ void msWFSFreeParamsObj(wfsParamsObj *wfsparams)
41394139
}
41404140
}
41414141

4142+
#ifdef USE_WFS_SVR
41424143
/************************************************************************/
41434144
/* msWFSGetDefaultVersion */
41444145
/************************************************************************/
@@ -4441,6 +4442,9 @@ static void msWFSSimplifyPropertyNameAndFilter(wfsParamsObj *wfsparams)
44414442
}
44424443
}
44434444

4445+
#endif /* USE_WFS_SVR */
4446+
4447+
44444448
/************************************************************************/
44454449
/* msWFSParseRequest */
44464450
/* */

mapwfs11.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ int msWFSGetCapabilities11(mapObj *map, wfsParamsObj *params,
487487
{
488488
msSetError( MS_WFSERR,
489489
"WFS 1.1 request made, but mapserver requires libxml2 for WFS 1.1 services and this is not configured.",
490-
"msWFSGetCapabilities11()", "NoApplicableCode" );
490+
"msWFSGetCapabilities11()" );
491491

492492
return msWFSException11(map, "mapserv", "NoApplicableCode", params->pszVersion);
493493
}

mapwfs20.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ int msWFSGetCapabilities20(mapObj *map, wfsParamsObj *params,
13151315
{
13161316
msSetError( MS_WFSERR,
13171317
"WFS 2.0 request made, but mapserver requires libxml2 for WFS 2.0 services and this is not configured.",
1318-
"msWFSGetCapabilities20()", "NoApplicableCode" );
1318+
"msWFSGetCapabilities20()" );
13191319

13201320
return msWFSException11(map, "mapserv", "NoApplicableCode", params->pszVersion);
13211321
}
@@ -1325,7 +1325,7 @@ int msWFSListStoredQueries20(mapObj *map, wfsParamsObj *params,
13251325
{
13261326
msSetError( MS_WFSERR,
13271327
"WFS 2.0 request made, but mapserver requires libxml2 for WFS 2.0 services and this is not configured.",
1328-
"msWFSListStoredQueries20()", "NoApplicableCode" );
1328+
"msWFSListStoredQueries20()");
13291329

13301330
return msWFSException11(map, "mapserv", "NoApplicableCode", params->pszVersion);
13311331
}
@@ -1335,19 +1335,19 @@ int msWFSDescribeStoredQueries20(mapObj *map, wfsParamsObj *params,
13351335
{
13361336
msSetError( MS_WFSERR,
13371337
"WFS 2.0 request made, but mapserver requires libxml2 for WFS 2.0 services and this is not configured.",
1338-
"msWFSDescribeStoredQueries20()", "NoApplicableCode" );
1338+
"msWFSDescribeStoredQueries20()" );
13391339

13401340
return msWFSException11(map, "mapserv", "NoApplicableCode", params->pszVersion);
13411341
}
13421342

13431343
char* msWFSGetResolvedStoredQuery20(mapObj *map,
1344-
wfsParamsObj *wfsparams,
1344+
wfsParamsObj *params,
13451345
const char* id,
13461346
hashTableObj* hashTable)
13471347
{
13481348
msSetError( MS_WFSERR,
13491349
"WFS 2.0 request made, but mapserver requires libxml2 for WFS 2.0 services and this is not configured.",
1350-
"msWFSGetResolvedStoredQuery20()", "NoApplicableCode" );
1350+
"msWFSGetResolvedStoredQuery20()" );
13511351

13521352
msWFSException11(map, "mapserv", "NoApplicableCode", params->pszVersion);
13531353
return NULL;

0 commit comments

Comments
 (0)