mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
targets: Add and change targets to support service process
This commit is contained in:
parent
220f37a75d
commit
7a70f86b2d
|
@ -17,3 +17,7 @@ add_subdirectory(cli)
|
|||
if(BUILD_TARGET_GUI)
|
||||
add_subdirectory(gui)
|
||||
endif()
|
||||
|
||||
if(XRT_BUILD_IPC)
|
||||
add_subdirectory(service)
|
||||
endif()
|
||||
|
|
|
@ -61,3 +61,5 @@ subdir('cli')
|
|||
if sdl2.found()
|
||||
subdir('gui')
|
||||
endif
|
||||
|
||||
subdir('service')
|
||||
|
|
|
@ -39,6 +39,13 @@ if(BUILD_WITH_SDL2)
|
|||
target_link_libraries(${RUNTIME_TARGET} PUBLIC st_gui imgui_impl_sdl)
|
||||
endif()
|
||||
|
||||
if(XRT_BUILD_IPC)
|
||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
||||
st_oxr
|
||||
ipc_client
|
||||
comp_client
|
||||
)
|
||||
else()
|
||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
||||
st_oxr
|
||||
st_prober
|
||||
|
@ -47,6 +54,7 @@ target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
|||
comp_main
|
||||
comp_client
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
# Force the main "negotiate" symbol's inclusion
|
||||
|
|
|
@ -78,11 +78,9 @@ openxr = library(
|
|||
lib_aux_util,
|
||||
lib_aux_math,
|
||||
lib_comp,
|
||||
lib_ipc_client,
|
||||
lib_st_oxr,
|
||||
lib_st_prober,
|
||||
lib_target_lists,
|
||||
lib_target_instance,
|
||||
] + driver_libs + hack_libs,
|
||||
] + hack_libs,
|
||||
include_directories: [
|
||||
openxr_include,
|
||||
st_include, # Sigh debian meson requires this.
|
||||
|
|
|
@ -6,6 +6,23 @@
|
|||
* @author Jakob Bornecrantz <jakob@collabora.com>
|
||||
*/
|
||||
|
||||
#include "xrt/xrt_config_build.h"
|
||||
|
||||
#ifdef XRT_BUILD_IPC
|
||||
|
||||
struct xrt_instance;
|
||||
|
||||
int
|
||||
ipc_instance_create(struct xrt_instance **out_xinst);
|
||||
|
||||
int
|
||||
xrt_instance_create(struct xrt_instance **out_xinst)
|
||||
{
|
||||
return ipc_instance_create(out_xinst);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "target_lists.h"
|
||||
|
||||
int
|
||||
|
@ -13,3 +30,5 @@ xrt_prober_create(struct xrt_prober **out_xp)
|
|||
{
|
||||
return xrt_prober_create_with_lists(out_xp, &target_lists);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
20
src/xrt/targets/service/CMakeLists.txt
Normal file
20
src/xrt/targets/service/CMakeLists.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2020, Collabora, Ltd.
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
|
||||
add_executable(monado-service
|
||||
main.c
|
||||
)
|
||||
|
||||
target_link_libraries(monado-service PRIVATE
|
||||
aux_util
|
||||
st_prober
|
||||
ipc_server
|
||||
comp_main
|
||||
target_lists
|
||||
target_instance
|
||||
)
|
||||
|
||||
install(TARGETS monado-service
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
28
src/xrt/targets/service/main.c
Normal file
28
src/xrt/targets/service/main.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2020, Collabora, Ltd.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
/*!
|
||||
* @file
|
||||
* @brief Main file for Monado service.
|
||||
* @author Pete Black <pblack@collabora.com>
|
||||
* @author Jakob Bornecrantz <jakob@collabora.com>
|
||||
* @ingroup ipc
|
||||
*/
|
||||
|
||||
|
||||
#include "target_lists.h"
|
||||
|
||||
int
|
||||
ipc_server_main(int argc, char *argv[]);
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
return ipc_server_main(argc, argv);
|
||||
}
|
||||
|
||||
int
|
||||
xrt_prober_create(struct xrt_prober **out_xp)
|
||||
{
|
||||
return xrt_prober_create_with_lists(out_xp, &target_lists);
|
||||
}
|
21
src/xrt/targets/service/meson.build
Normal file
21
src/xrt/targets/service/meson.build
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Copyright 2020, Collabora, Ltd.
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
service = executable(
|
||||
'monado-service',
|
||||
['main.c'],
|
||||
link_whole: [
|
||||
lib_st_prober,
|
||||
lib_ipc_server,
|
||||
lib_comp,
|
||||
lib_target_lists,
|
||||
lib_target_instance,
|
||||
lib_aux_util,
|
||||
] + driver_libs,
|
||||
include_directories: [
|
||||
aux_include,
|
||||
common_include,
|
||||
xrt_include,
|
||||
],
|
||||
dependencies: [pthreads, libjpeg],
|
||||
)
|
Loading…
Reference in a new issue