Skip to content

Commit

Permalink
Fix build with WITH_BINDINGS=yes and WITH_QTSERIALPORT=no
Browse files Browse the repository at this point in the history
auto_generated/sensor/qgsabstractsensor.sip: In function ‘const sipTypeDef* sipSubClass_QgsAbstractSensor(void**)’:
auto_generated/sensor/qgsabstractsensor.sip:35: error: ‘QgsSerialPortSensor’ does not name a type; did you mean ‘sipName_QgsSerialPortSensor’?
  • Loading branch information
cjmayo authored and github-actions[bot] committed Jun 25, 2023
1 parent b9862de commit 294e610
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/CMakeLists.txt
Expand Up @@ -170,6 +170,10 @@ if(NOT WITH_GUI)
set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_GUI)
endif()

if(NOT WITH_QTSERIALPORT)
set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_QTSERIALPORT)
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/core/project.py.in ${CMAKE_CURRENT_BINARY_DIR}/core/project.py @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/core/pyproject.toml.in ${CMAKE_CURRENT_BINARY_DIR}/core/pyproject.toml @ONLY)
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._core core/core.sip "${sip_files_core}" cpp_files)
Expand Down
2 changes: 2 additions & 0 deletions python/core/auto_generated/sensor/qgsabstractsensor.sip.in
Expand Up @@ -32,10 +32,12 @@ An abstract base class for sensor classes
{
sipType = sipType_QgsUdpSocketSensor;
}
#if defined( HAVE_QTSERIALPORT )
else if ( item->type() == QLatin1String( "serial_port" ) && dynamic_cast<QgsSerialPortSensor *>( item ) != NULL )
{
sipType = sipType_QgsSerialPortSensor;
}
#endif
else
{
sipType = sipType_QgsAbstractSensor;
Expand Down
2 changes: 2 additions & 0 deletions python/core/auto_generated/sensor/qgsiodevicesensor.sip.in
Expand Up @@ -184,6 +184,7 @@ Sets the ``port`` the socket connects to.

};

%If (HAVE_QTSERIALPORT)

class QgsSerialPortSensor : QgsIODeviceSensor
{
Expand Down Expand Up @@ -239,6 +240,7 @@ Sets the serial port the sensor connects to.


};
%End



Expand Down
1 change: 1 addition & 0 deletions python/core/core.sip.in
Expand Up @@ -100,6 +100,7 @@ done:
%Import QtPositioning/QtPositioningmod.sip

%Feature HAVE_GUI
%Feature HAVE_QTSERIALPORT
%Feature ANDROID
%Feature VECTOR_MAPPED_TYPE

Expand Down
2 changes: 2 additions & 0 deletions src/core/sensor/qgsabstractsensor.h
Expand Up @@ -50,10 +50,12 @@ class CORE_EXPORT QgsAbstractSensor : public QObject
{
sipType = sipType_QgsUdpSocketSensor;
}
#if defined( HAVE_QTSERIALPORT )
else if ( item->type() == QLatin1String( "serial_port" ) && dynamic_cast<QgsSerialPortSensor *>( item ) != NULL )
{
sipType = sipType_QgsSerialPortSensor;
}
#endif
else
{
sipType = sipType_QgsAbstractSensor;
Expand Down
2 changes: 2 additions & 0 deletions src/core/sensor/qgsiodevicesensor.h
Expand Up @@ -220,6 +220,7 @@ class CORE_EXPORT QgsUdpSocketSensor : public QgsIODeviceSensor
};

#if defined( HAVE_QTSERIALPORT )
SIP_IF_FEATURE( HAVE_QTSERIALPORT )

/**
* \ingroup core
Expand Down Expand Up @@ -279,6 +280,7 @@ class CORE_EXPORT QgsSerialPortSensor : public QgsIODeviceSensor
QString mPortName;

};
SIP_END
#endif

#endif //QGSIODEVICESENSOR_H
Expand Down

0 comments on commit 294e610

Please sign in to comment.