LookingGlass/host/platform/Windows/CMakeLists.txt
Quantum 56833edae7 [host] delay: directly link against ntdll.dll
There is no need to LoadLibrary and GetProcAddress to get pointers to
NtDelayExecution or NtSetTimerResolution. These functions don't have
prototypes in any SDK header, but they are exported in ntdll.dll and
we can simply declare the prototype and link ntdll.

There is also no chance that the functions do not exist: I checked an
old install of Windows NT 4.0 and both of these functions exist.

Also used NtSetTimerResolution instead of ZeSetTimerResolution for
consistency (they are the same).

Also changed system timer resolution log message units to μs with
one decimal digit for readability. This is the actual amount of
precision available to us.
2021-07-20 11:30:12 +10:00

44 lines
919 B
CMake

cmake_minimum_required(VERSION 3.0)
project(platform_Windows LANGUAGES C)
include_directories(
${PROJECT_SOURCE_DIR}/include
)
add_library(platform_Windows STATIC
src/platform.c
src/service.c
src/mousehook.c
src/force_compose.c
src/delay.c
resource.rc
)
# allow use of functions for Windows Vista or later
add_definitions(-D _WIN32_WINNT=0x6000)
add_subdirectory("capture")
target_link_libraries(platform_Windows
lg_common
capture
userenv
ntdll
wtsapi32
psapi
shlwapi
powrprof
rpcrt4
)
target_include_directories(platform_Windows
PRIVATE
src
)
# these are for the nsis installer generator
configure_file("${PROJECT_SOURCE_DIR}/installer.nsi" "${PROJECT_BINARY_DIR}/installer.nsi" COPYONLY)
configure_file("${PROJECT_TOP}/resources/icon.ico" "${PROJECT_BINARY_DIR}/icon.ico" COPYONLY)
configure_file("${PROJECT_TOP}/LICENSE" "${PROJECT_BINARY_DIR}/LICENSE.txt" COPYONLY)