[cmake] add explicit instructions to turn off unmaintained modules

* Add detailed CMake warning to disable unmaintained modules
* Add sample shadow subsystem implementation
* Allow building shadow server with dummy subsystem
This commit is contained in:
akallabeth 2025-03-17 12:15:04 +01:00
parent 13cacd5010
commit e3c93573f3
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
13 changed files with 259 additions and 14 deletions

View File

@ -26,7 +26,10 @@ endif()
if(FREERDP_VENDOR AND WITH_CLIENT)
if(WIN32 AND NOT UWP)
add_subdirectory(Windows)
option(WITH_CLIENT_WINDOWS "Build native windows client" ON)
if(WITH_CLIENT_WINDOWS)
add_subdirectory(Windows)
endif()
else()
if(WITH_SAMPLE)
add_subdirectory(Sample)
@ -47,10 +50,13 @@ if(FREERDP_VENDOR AND WITH_CLIENT)
if(APPLE)
if(IOS)
if(NOT WITHOUT_FREERDP_3x_DEPRECATED)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/iOS")
message(STATUS "Adding iOS client")
add_subdirectory(iOS)
option(WITH_CLIENT_IOS "Build native iOS client" ON)
if(WITH_CLIENT_IOS)
if(NOT WITHOUT_FREERDP_3x_DEPRECATED)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/iOS")
message(STATUS "Adding iOS client")
add_subdirectory(iOS)
endif()
endif()
endif()
else()

View File

@ -19,6 +19,9 @@
set(MODULE_NAME "wlfreerdp")
set(MODULE_PREFIX "FREERDP_CLIENT_WAYLAND")
include(WarnUnmaintained)
warn_unmaintained(${MODULE_NAME} "-DWITH_CLIENT_WAYLAND=OFF")
include_directories(SYSTEM ${WAYLAND_INCLUDE_DIR})
set(${MODULE_PREFIX}_SRCS

View File

@ -18,6 +18,9 @@
set(MODULE_NAME "wfreerdp-client")
set(MODULE_PREFIX "FREERDP_CLIENT_WINDOWS_CONTROL")
include(WarnUnmaintained)
warn_unmaintained(${MODULE_NAME} "-DWITH_CLIENT_WINDOWS=OFF")
set(${MODULE_PREFIX}_SRCS
wf_gdi.c
wf_gdi.h

View File

@ -28,6 +28,9 @@ message("project ${PROJECT_NAME} is using version ${PROJECT_VERSION}")
list(APPEND CMAKE_MODULE_PATH ${PROJECT_CURRENT_SOURCE_DIR}/../../cmake/)
include(CommonConfigOptions)
include(WarnUnmaintained)
warn_unmaintained(${PROJECT_NAME} "-DWITH_CLIENT_IOS=OFF")
set(MODULE_NAME "iFreeRDP")
set(MODULE_PREFIX "IFREERDP_CLIENT")
set(APP_TYPE MACOSX_BUNDLE)

View File

@ -11,4 +11,5 @@ macro(warn_unmaintained name)
"[unmaintained] - don't hesitate to ask some questions. (replies might take some time depending on your timezone)"
)
message(WARNING "[unmaintained] - if you intend using this component write us a message")
message(WARNING "[unmaintained] use ${ARGN} to disable")
endmacro()

View File

@ -18,6 +18,9 @@
set(MODULE_NAME "mfreerdp-server")
set(MODULE_PREFIX "FREERDP_SERVER_MAC")
include(WarnUnmaintained)
warn_unmaintained(${MODULE_NAME} "-DWITH_PLATFORM_SERVER=OFF")
find_library(AUDIO_TOOL AudioToolbox)
find_library(CORE_AUDIO CoreAudio)
find_library(CORE_VIDEO CoreVideo)

View File

@ -19,7 +19,7 @@ set(MODULE_NAME "wfreerdp-server")
set(MODULE_PREFIX "FREERDP_SERVER_WINDOWS")
include(WarnUnmaintained)
warn_unmaintained(${MODULE_NAME})
warn_unmaintained(${MODULE_NAME} "-DWITH_PLATFORM_SERVER=OFF")
include_directories(.)

View File

@ -92,12 +92,17 @@ set(MODULE_NAME "freerdp-shadow-subsystem")
set(SRCS shadow_subsystem_builtin.c)
if(WIN32)
add_subdirectory(Win)
elseif(NOT APPLE)
add_subdirectory(X11)
elseif(APPLE AND NOT IOS)
add_subdirectory(Mac)
option(WITH_SHADOW_SUBSYSTEM "Build actual shadow platform subsystem implementation" ON)
if(WITH_SHADOW_SUBSYSTEM)
if(WIN32)
add_subdirectory(Win)
elseif(NOT APPLE)
add_subdirectory(X11)
elseif(APPLE AND NOT IOS)
add_subdirectory(Mac)
endif()
else()
add_subdirectory(Sample)
endif()
addtargetwithresourcefile(${MODULE_NAME} FALSE "${FREERDP_VERSION}" SRCS)

View File

@ -1,5 +1,5 @@
include(WarnUnmaintained)
warn_unmaintained("mac shadow server subsystem")
warn_unmaintained("mac shadow server subsystem" "-DWITH_SHADOW_SUBSYSTEM=OFF")
find_library(IOKIT IOKit REQUIRED)
find_library(IOSURFACE IOSurface REQUIRED)

View File

@ -0,0 +1 @@
add_library(freerdp-shadow-subsystem-impl STATIC sample_shadow.c sample_shadow.h)

View File

@ -0,0 +1,177 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
*
* Copyright 2025 Armin Novak <anovak@thincast.com>
* Copyright 2025 Thincast Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/sysinfo.h>
#include <freerdp/log.h>
#include <freerdp/codec/color.h>
#include <freerdp/codec/region.h>
#include <freerdp/server/server-common.h>
#include "sample_shadow.h"
#define TAG SERVER_TAG("shadow.sample")
static BOOL sample_shadow_input_synchronize_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
WINPR_ATTR_UNUSED rdpShadowClient* client,
WINPR_ATTR_UNUSED UINT32 flags)
{
WLog_WARN(TAG, "TODO: Implement!");
return TRUE;
}
static BOOL sample_shadow_input_keyboard_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
WINPR_ATTR_UNUSED rdpShadowClient* client,
WINPR_ATTR_UNUSED UINT16 flags,
WINPR_ATTR_UNUSED UINT8 code)
{
WLog_WARN(TAG, "TODO: Implement!");
return TRUE;
}
static BOOL sample_shadow_input_unicode_keyboard_event(
WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem, WINPR_ATTR_UNUSED rdpShadowClient* client,
WINPR_ATTR_UNUSED UINT16 flags, WINPR_ATTR_UNUSED UINT16 code)
{
WLog_WARN(TAG, "TODO: Implement!");
return TRUE;
}
static BOOL sample_shadow_input_mouse_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
WINPR_ATTR_UNUSED rdpShadowClient* client,
WINPR_ATTR_UNUSED UINT16 flags,
WINPR_ATTR_UNUSED UINT16 x, WINPR_ATTR_UNUSED UINT16 y)
{
WLog_WARN(TAG, "TODO: Implement!");
return TRUE;
}
static BOOL sample_shadow_input_extended_mouse_event(
WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem, WINPR_ATTR_UNUSED rdpShadowClient* client,
WINPR_ATTR_UNUSED UINT16 flags, WINPR_ATTR_UNUSED UINT16 x, WINPR_ATTR_UNUSED UINT16 y)
{
WLog_WARN(TAG, "TODO: Implement!");
return TRUE;
}
static UINT32 sample_shadow_enum_monitors(WINPR_ATTR_UNUSED MONITOR_DEF* monitors,
WINPR_ATTR_UNUSED UINT32 maxMonitors)
{
WLog_WARN(TAG, "TODO: Implement!");
return 0;
}
static int sample_shadow_subsystem_init(rdpShadowSubsystem* arg)
{
sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
WINPR_ASSERT(subsystem);
subsystem->base.numMonitors = sample_shadow_enum_monitors(subsystem->base.monitors, 16);
WLog_WARN(TAG, "TODO: Implement!");
MONITOR_DEF* virtualScreen = &(subsystem->base.virtualScreen);
virtualScreen->left = 0;
virtualScreen->top = 0;
virtualScreen->right = 0;
virtualScreen->bottom = 0;
virtualScreen->flags = 1;
return 1;
}
static int sample_shadow_subsystem_uninit(rdpShadowSubsystem* arg)
{
sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
if (!subsystem)
return -1;
WLog_WARN(TAG, "TODO: Implement!");
return 1;
}
static int sample_shadow_subsystem_start(rdpShadowSubsystem* arg)
{
sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
if (!subsystem)
return -1;
WLog_WARN(TAG, "TODO: Implement!");
return 1;
}
static int sample_shadow_subsystem_stop(rdpShadowSubsystem* arg)
{
sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
if (!subsystem)
return -1;
WLog_WARN(TAG, "TODO: Implement!");
return 1;
}
static void sample_shadow_subsystem_free(rdpShadowSubsystem* arg)
{
sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
if (!subsystem)
return;
sample_shadow_subsystem_uninit(arg);
free(subsystem);
}
static rdpShadowSubsystem* sample_shadow_subsystem_new(void)
{
sampleShadowSubsystem* subsystem =
(sampleShadowSubsystem*)calloc(1, sizeof(sampleShadowSubsystem));
if (!subsystem)
return NULL;
subsystem->base.SynchronizeEvent = sample_shadow_input_synchronize_event;
subsystem->base.KeyboardEvent = sample_shadow_input_keyboard_event;
subsystem->base.UnicodeKeyboardEvent = sample_shadow_input_unicode_keyboard_event;
subsystem->base.MouseEvent = sample_shadow_input_mouse_event;
subsystem->base.ExtendedMouseEvent = sample_shadow_input_extended_mouse_event;
return &subsystem->base;
}
const char* ShadowSubsystemName(void)
{
return "Sample";
}
int ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints)
{
pEntryPoints->New = sample_shadow_subsystem_new;
pEntryPoints->Free = sample_shadow_subsystem_free;
pEntryPoints->Init = sample_shadow_subsystem_init;
pEntryPoints->Uninit = sample_shadow_subsystem_uninit;
pEntryPoints->Start = sample_shadow_subsystem_start;
pEntryPoints->Stop = sample_shadow_subsystem_stop;
pEntryPoints->EnumMonitors = sample_shadow_enum_monitors;
return 1;
}

View File

@ -0,0 +1,43 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
*
* Copyright 2025 Armin Novak <anovak@thincast.com>
* Copyright 2025 Thincast Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <freerdp/server/shadow.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct sample_shadow_subsystem sampleShadowSubsystem;
struct sample_shadow_subsystem
{
rdpShadowSubsystem base;
/* Additional platform specific stuff goes here */
};
FREERDP_API const char* ShadowSubsystemName(void);
FREERDP_API int ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
include(WarnUnmaintained)
warn_unmaintained("windows shadow server subsystem")
warn_unmaintained("windows shadow server subsystem" "-DWITH_SHADOW_SUBSYSTEM=OFF")
add_compile_definitions(WITH_SHADOW_WIN)
add_library(