Skip to content

Commit 53b9be1

Browse files
build(cmake): check for MinHook during configure (#3533)
Co-authored-by: Lukas Senionis <[email protected]>
1 parent 820180c commit 53b9be1

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

cmake/compile_definitions/windows.cmake

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,27 @@ set(OPENSSL_LIBRARIES
6464
libcrypto.a)
6565

6666
list(PREPEND PLATFORM_LIBRARIES
67+
${CURL_STATIC_LIBRARIES}
68+
avrt
69+
d3d11
70+
D3DCompiler
71+
dwmapi
72+
dxgi
73+
iphlpapi
74+
ksuser
75+
libssp.a
6776
libstdc++.a
6877
libwinpthread.a
69-
libssp.a
78+
minhook::minhook
79+
nlohmann_json::nlohmann_json
7080
ntdll
71-
ksuser
72-
wsock32
73-
ws2_32
74-
d3d11 dxgi D3DCompiler
7581
setupapi
76-
dwmapi
77-
userenv
78-
synchronization.lib
79-
avrt
80-
iphlpapi
8182
shlwapi
82-
PkgConfig::NLOHMANN_JSON
83-
${CURL_STATIC_LIBRARIES})
83+
synchronization.lib
84+
userenv
85+
ws2_32
86+
wsock32
87+
)
8488

8589
if(SUNSHINE_ENABLE_TRAY)
8690
list(APPEND PLATFORM_TARGET_FILES

cmake/dependencies/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ include_directories(SYSTEM ${MINIUPNP_INCLUDE_DIRS})
2828
# ffmpeg pre-compiled binaries
2929
if(NOT DEFINED FFMPEG_PREPARED_BINARIES)
3030
if(WIN32)
31-
set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid vpl MinHook)
31+
set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid vpl)
3232
elseif(UNIX AND NOT APPLE)
3333
set(FFMPEG_PLATFORM_LIBRARIES numa va va-drm va-x11 X11)
3434
endif()

cmake/dependencies/windows.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# windows specific dependencies
22

33
# nlohmann_json
4-
pkg_check_modules(NLOHMANN_JSON nlohmann_json REQUIRED IMPORTED_TARGET)
4+
find_package(nlohmann_json CONFIG 3.11 REQUIRED)
5+
6+
# Make sure MinHook is installed
7+
find_library(MINHOOK_LIBRARY minhook REQUIRED)
8+
find_path(MINHOOK_INCLUDE_DIR MinHook.h PATH_SUFFIXES include REQUIRED)
9+
10+
add_library(minhook::minhook UNKNOWN IMPORTED)
11+
set_property(TARGET minhook::minhook PROPERTY IMPORTED_LOCATION ${MINHOOK_LIBRARY})
12+
target_include_directories(minhook::minhook INTERFACE ${MINHOOK_INCLUDE_DIR})

0 commit comments

Comments
 (0)