Create standalone Wine accessibility helper
This commit is contained in:
commit
ed7ff763fb
7 files changed
+932
No files matched your search
@@ -0,0 +1,38 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(wine_access LANGUAGES C CXX)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
set(WINE_ACCESS_INSTALL_DIR "${CMAKE_INSTALL_LIBEXECDIR}/cthulhu/wine" CACHE PATH
|
||||
"Installation directory for the Wine helper and its Winelib sidecar")
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||
find_program(WIDL_EXECUTABLE widl REQUIRED)
|
||||
|
||||
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
set(generated_header "${generated_dir}/nvdaController.h")
|
||||
set(generated_server "${generated_dir}/nvdaController_s.c")
|
||||
file(MAKE_DIRECTORY "${generated_dir}")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${generated_header}" "${generated_server}"
|
||||
COMMAND "${WIDL_EXECUTABLE}" --win64 -h -H "${generated_header}"
|
||||
-s -S "${generated_server}" "${CMAKE_CURRENT_SOURCE_DIR}/nvdaController.idl"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/nvdaController.idl"
|
||||
VERBATIM)
|
||||
|
||||
add_executable(cthulhu-wine-access main.cpp "${generated_server}")
|
||||
target_compile_features(cthulhu-wine-access PRIVATE cxx_std_20)
|
||||
target_include_directories(cthulhu-wine-access PRIVATE "${generated_dir}")
|
||||
target_link_libraries(cthulhu-wine-access PRIVATE
|
||||
PkgConfig::GIO oleacc ole32 oleaut32 rpcrt4 user32)
|
||||
target_link_options(cthulhu-wine-access PRIVATE -mwindows)
|
||||
target_compile_options(cthulhu-wine-access PRIVATE
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:-Wall -Wextra>)
|
||||
|
||||
# Winegcc emits a launcher and a Winelib sidecar. CMake's normal target
|
||||
# installation looks for the Linux target name, so install both emitted
|
||||
# artifacts explicitly and keep them together for Wine to resolve.
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cthulhu-wine-access.exe"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cthulhu-wine-access.exe.so"
|
||||
DESTINATION "${WINE_ACCESS_INSTALL_DIR}")
|
||||
Reference in new issue
Block a user