2019-04-09 06:28:11 +00:00
|
|
|
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
|
2020-08-11 02:22:22 +00:00
|
|
|
src/service.c
|
2019-04-10 11:07:56 +00:00
|
|
|
src/mousehook.c
|
[host] nvfbc: force composition to capture some full screen apps
NvFBC is unable to capture certain applications that bypasses the DWM
compositor, for example, Firefox playing video in full screen. This
has been a known issue for a long time with Nvidia's ShadowPlay, see:
* https://www.nvidia.com/en-us/geforce/forums/geforce-experience/14/233709/
* https://crbug.com/609857
Nvidia won't fix this, but there are workarounds. For example, we
create a transparent 1x1 layered window, which forces desktop composition
to be enabled.
Note that SetLayeredWindowAttributes also supports alpha-based transparency,
but setting transparency to 0 will cause DWM to skip composition. We could
use a transparency of 1, but this ruins the image by the slightest bit,
which is unacceptable. Therefore, we must use chroma key-based
transparency, which tricks DWM into compositing despite being fully
transparent.
2021-01-20 07:11:49 +00:00
|
|
|
src/force_compose.c
|
2021-07-17 04:55:22 +00:00
|
|
|
src/delay.c
|
2019-04-09 06:28:11 +00:00
|
|
|
)
|
|
|
|
|
2021-07-20 02:03:05 +00:00
|
|
|
# allow use of functions for Windows 7 or later
|
|
|
|
add_compile_definitions(WINVER=0x0601 _WIN32_WINNT=0x0601)
|
2021-01-14 23:55:36 +00:00
|
|
|
|
2019-04-09 06:28:11 +00:00
|
|
|
add_subdirectory("capture")
|
|
|
|
|
2021-07-21 05:30:13 +00:00
|
|
|
if (MINGW)
|
|
|
|
# Build our own ntdll.dll import library
|
|
|
|
# This tricks MinGW into not linking stuff like memcpy from ntdll.dll instead of mscvrt.dll
|
2021-07-24 02:16:44 +00:00
|
|
|
if(NOT CMAKE_DLLTOOL)
|
|
|
|
# cmake older than 3.16 doesn't know how to find dlltool
|
|
|
|
find_program(CMAKE_DLLTOOL NAMES "x86_64-w64-mingw32-dlltool" "dlltool.exe" DOC "dlltool executable")
|
|
|
|
endif()
|
2021-07-21 05:30:13 +00:00
|
|
|
add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/ntdll.a"
|
2021-07-24 02:16:44 +00:00
|
|
|
COMMAND "${CMAKE_DLLTOOL}" -d "${PROJECT_SOURCE_DIR}/ntdll.def" -l "${PROJECT_BINARY_DIR}/ntdll.a"
|
2021-07-21 05:30:13 +00:00
|
|
|
MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/ntdll.def"
|
|
|
|
COMMENT "Building import library ntdll.a"
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
add_custom_target(ntdll_target DEPENDS "${PROJECT_BINARY_DIR}/ntdll.a")
|
|
|
|
add_library(ntdll STATIC IMPORTED GLOBAL)
|
|
|
|
add_dependencies(ntdll ntdll_target)
|
|
|
|
set_target_properties(ntdll PROPERTIES IMPORTED_LOCATION "${PROJECT_BINARY_DIR}/ntdll.a")
|
|
|
|
endif()
|
|
|
|
|
2019-04-09 06:28:11 +00:00
|
|
|
target_link_libraries(platform_Windows
|
2019-04-11 01:03:30 +00:00
|
|
|
lg_common
|
2019-04-09 06:28:11 +00:00
|
|
|
capture
|
2020-08-11 02:22:22 +00:00
|
|
|
|
|
|
|
userenv
|
2021-07-19 23:06:13 +00:00
|
|
|
ntdll
|
2020-08-11 02:22:22 +00:00
|
|
|
wtsapi32
|
2020-08-11 03:15:18 +00:00
|
|
|
psapi
|
2021-01-29 01:39:05 +00:00
|
|
|
shlwapi
|
2021-02-03 22:42:54 +00:00
|
|
|
powrprof
|
2021-07-19 10:16:27 +00:00
|
|
|
rpcrt4
|
2019-04-09 06:28:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(platform_Windows
|
|
|
|
PRIVATE
|
|
|
|
src
|
|
|
|
)
|
2020-08-12 11:50:48 +00:00
|
|
|
|
|
|
|
# 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)
|