[cmake,freerdp] add WITH_FREERDP_3x_DEPRECATED

This new CMake option (ON by default) allows building the library with
all symbols deprecated during 3.x release cycle disabled.
This allows compatibility testing external applications for future
FreeRDP 4.x support
This commit is contained in:
akallabeth
2025-03-03 17:26:41 +01:00
parent 8ea2c5dde6
commit d03b4b91d5
19 changed files with 73 additions and 13 deletions

View File

@@ -101,11 +101,13 @@ def write_getter_body(f, values, ret, keys, isPointer, compat_values, typestr, e
cast = '(void*)'
write_getter_case(f, val, cast, None)
if compat_values:
f.write('#if defined(WITH_FREERDP_3x_DEPRECATED)\n')
for i in range(len(compat_values)):
val = compat_values[i]
cast = '(' + entry_type + ')'
f.write('\t\t// API Compatibility section, remove with FreeRDP 4.x\n')
write_getter_case(f, val, cast, typestr)
f.write('#endif\n')
f.write('\t\tdefault:\n')
f.write('\t\t\tWLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id, freerdp_settings_get_name_for_key(id), freerdp_settings_get_type_name_for_key(id));\n')
f.write('\t\t\tWINPR_ASSERT(FALSE);\n')
@@ -217,10 +219,12 @@ def write_setter(f, entry_dict, entry_type, entry_name, postfix, compat_dict):
cast = '(' + k + ')'
write_setter_case(f, val, postfix, isPointer, cast)
if compat_values:
f.write('#if defined(WITH_FREERDP_3x_DEPRECATED)\n')
for val in compat_values:
cast = '(int32_t)'
f.write('\t\t// API Compatibility section, remove with FreeRDP 4.x\n')
write_setter_case(f, val, postfix, isPointer, cast)
f.write('#endif\n')
f.write('\t\tdefault:\n')
f.write('\t\t\tWLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id, freerdp_settings_get_name_for_key(id), freerdp_settings_get_type_name_for_key(id));\n')
f.write('\t\t\treturn FALSE;\n')