[cmake] do not require NTDLL

This commit is contained in:
akallabeth 2023-08-03 16:49:42 +02:00 committed by akallabeth
parent c8ce3eba06
commit b12e2ee469
3 changed files with 12 additions and 4 deletions

View File

@ -101,8 +101,12 @@ list(APPEND LIBS winpr freerdp)
find_library(MSIMG32 NAME msimg32 REQUIRED)
find_library(CREDUI NAME credui REQUIRED)
find_library(NTDLL NAME ntdll REQUIRED)
list(APPEND LIBS ${MSIMG32} ${CREDUI} ${NTDLL})
list(APPEND LIBS ${MSIMG32} ${CREDUI})
find_library(NTDLL NAME ntdll) # optional, only required with MINGW
if (NTDLL)
list(APPEND LIBS ${NTDLL})
endif()
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS})
if(WITH_CLIENT_INTERFACE)

View File

@ -20,11 +20,13 @@ winpr_module_add(wtsapi.c)
if(WIN32)
winpr_module_add(wtsapi_win32.c wtsapi_win32.h)
# Only required with MINGW
find_library(NTDLL
NAME ntdll
REQUIRED
)
winpr_library_add_private(${NTDLL})
if (NTDLL)
winpr_library_add_private(${NTDLL})
endif()
endif()
if(BUILD_TESTING)

View File

@ -32,6 +32,8 @@
#include <winternl.h>
#pragma comment(lib, "ntdll.lib")
#define WTSAPI_CHANNEL_MAGIC 0x44484356
#define TAG WINPR_TAG("wtsapi")