Skip to content

Commit

Permalink
fix(Build): remove some deprecated warnings
Browse files Browse the repository at this point in the history
Because either
- non working Q_NOWARN_DEPRECATED_PUSH/POP in recent clang versions
- newly deprecated 3d classes
- Indirect used of Qt 3d deprecated classes
  • Loading branch information
troopa81 committed Feb 4, 2025
1 parent dd03eeb commit 56a493e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ set (QGIS_3D_RCCS shaders.qrc ../../resources/3d/textures/textures.qrc)
#############################################################
# qgis_3d library

# Workaround CLANG deprecation warning
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set_source_files_properties(
# Use deprecated QAbstractFunctor used by QAbstractTextureImage (also deprecated in 6.8)
qgsgltf3dutils.cpp mesh/qgsmesh3dmaterial_p.cpp terrain/qgsterraintextureimage_p.cpp qgscolorramptexture.cpp
terrain/qgsdemterraintilegeometry_p.cpp # Use deprecated QAbstractFunctor
PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
endif()

add_library(qgis_3d SHARED ${QGIS_3D_SRCS} ${QGIS_3D_HDRS} ${QGIS_3D_RCCS} ${QGIS_3D_PRIVATE_HDRS})

Expand Down
5 changes: 5 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,11 @@ else()
endif()
endif()

# Workaround CLANG deprecation warning, for unknown reasons Q_NOWARN_DEPRECATED_PUSH/POP is not working
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set_source_files_properties(painting/qgsmaskpaintdevice.cpp PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
endif()

# Generate cpp+header file from .proto file using "protoc" tool (to support MVT encoding of vector tiles)
protobuf_generate_cpp(VECTOR_TILE_PROTO_SRCS VECTOR_TILE_PROTO_HDRS vectortile/vector_tile.proto)
set(QGIS_CORE_SRCS ${QGIS_CORE_SRCS} ${VECTOR_TILE_PROTO_SRCS})
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsrastercalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@ void TestQgsRasterCalculator::calcWithDataType_data()
void TestQgsRasterCalculator::calcWithDataType()
{
QFETCH( int, dataType );
QFETCH( bool, useOpenCL );

#ifdef HAVE_OPENCL
QFETCH( bool, useOpenCL );
if ( QgsOpenClUtils::available() && useOpenCL )
QgsOpenClUtils::setEnabled( useOpenCL );
else
Expand Down

0 comments on commit 56a493e

Please sign in to comment.