mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
[Build] Reject APIs deprecated before Qt 6.4 (#7632)
Add the deprecation cutoff after FindQtRuntime so the compiler rejects any API deprecated before the project's minimum Qt version. Qt 6.5 renamed the switch, so the fallback name is used on 6.4. The full client, Oracle, server and test build passes with the cutoff enabled. Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
f2c359ba9f
commit
d4002dc52b
1 changed files with 9 additions and 0 deletions
|
|
@ -250,6 +250,15 @@ message(STATUS "Update Translations: ${UPDATE_TRANSLATIONS}")
|
|||
|
||||
include(FindQtRuntime)
|
||||
|
||||
# Reject APIs that were deprecated before the oldest Qt release we support
|
||||
# (6.4). Qt 6.5 renamed the switch, so use whichever spelling the found
|
||||
# version understands while still compiling everywhere.
|
||||
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.5)
|
||||
add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x060400)
|
||||
else()
|
||||
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060400)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC TRUE)
|
||||
|
||||
# Find other needed libraries
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue