Skip to content

Commit e839f27

Browse files
committedApr 3, 2019
Disable WITH_SERVER_PLUGINS when WITH_BINDINGS=FALSE
1 parent 21e08c2 commit e839f27

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
 

‎CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@ IF(WITH_CORE)
128128
IF(WITH_SERVER)
129129
SET (SERVER_SKIP_ECW FALSE CACHE BOOL "Determines whether QGIS server should disable ECW (ECW in server apps requires a special license)")
130130

131-
SET (WITH_SERVER_PLUGINS TRUE CACHE BOOL "Determines whether QGIS server support for python plugins should be built")
131+
SET (WITH_SERVER_PLUGINS ${WITH_BINDINGS} CACHE BOOL "Determines whether QGIS server support for python plugins should be built")
132+
IF(WITH_SERVER_PLUGINS AND NOT WITH_BINDINGS)
133+
MESSAGE(FATAL_ERROR "Server plugins are not supported without python bindings. Enable WITH_BINDINGS or disable WITH_SERVER_PLUGINS")
134+
ENDIF(WITH_SERVER_PLUGINS AND NOT WITH_BINDINGS)
132135
IF(WITH_SERVER_PLUGINS)
133136
SET(HAVE_SERVER_PYTHON_PLUGINS TRUE)
134137
ENDIF(WITH_SERVER_PLUGINS)
138+
135139
ENDIF(WITH_SERVER)
136140

137141
# Custom widgets

‎src/server/services/wms/qgswmsgetlegendgraphics.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ namespace QgsWms
3434
// get parameters from query
3535
QgsWmsParameters parameters( QUrlQuery( request.url() ) );
3636

37+
// init render context
38+
QgsWmsRenderContext context( project, serverIface );
39+
context.setFlag( QgsWmsRenderContext::UseScaleDenominator );
40+
context.setParameters( parameters );
41+
3742
const QString format = request.parameters().value( QStringLiteral( "FORMAT" ), QStringLiteral( "PNG" ) );
3843
ImageOutputFormat outputFormat = parseImageFormat( format );
3944

@@ -76,11 +81,6 @@ namespace QgsWms
7681
}
7782
}
7883
#endif
79-
// init render context
80-
QgsWmsRenderContext context( project, serverIface );
81-
context.setFlag( QgsWmsRenderContext::UseScaleDenominator );
82-
context.setParameters( parameters );
83-
8484
QgsRenderer renderer( context );
8585

8686
std::unique_ptr<QImage> result( renderer.getLegendGraphics() );

0 commit comments

Comments
 (0)
Please sign in to comment.