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)
|
if(BUILD_TARGET_GUI)
|
||||||
add_subdirectory(gui)
|
add_subdirectory(gui)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(XRT_BUILD_IPC)
|
||||||
|
add_subdirectory(service)
|
||||||
|
endif()
|
||||||
|
|
|
@ -61,3 +61,5 @@ subdir('cli')
|
||||||
if sdl2.found()
|
if sdl2.found()
|
||||||
subdir('gui')
|
subdir('gui')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
subdir('service')
|
||||||
|
|
|
@ -39,14 +39,22 @@ if(BUILD_WITH_SDL2)
|
||||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC st_gui imgui_impl_sdl)
|
target_link_libraries(${RUNTIME_TARGET} PUBLIC st_gui imgui_impl_sdl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
if(XRT_BUILD_IPC)
|
||||||
st_oxr
|
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
||||||
st_prober
|
st_oxr
|
||||||
target_lists
|
ipc_client
|
||||||
target_instance
|
comp_client
|
||||||
comp_main
|
)
|
||||||
comp_client
|
else()
|
||||||
)
|
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
||||||
|
st_oxr
|
||||||
|
st_prober
|
||||||
|
target_lists
|
||||||
|
target_instance
|
||||||
|
comp_main
|
||||||
|
comp_client
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
# Force the main "negotiate" symbol's inclusion
|
# Force the main "negotiate" symbol's inclusion
|
||||||
|
|
|
@ -78,11 +78,9 @@ openxr = library(
|
||||||
lib_aux_util,
|
lib_aux_util,
|
||||||
lib_aux_math,
|
lib_aux_math,
|
||||||
lib_comp,
|
lib_comp,
|
||||||
|
lib_ipc_client,
|
||||||
lib_st_oxr,
|
lib_st_oxr,
|
||||||
lib_st_prober,
|
] + hack_libs,
|
||||||
lib_target_lists,
|
|
||||||
lib_target_instance,
|
|
||||||
] + driver_libs + hack_libs,
|
|
||||||
include_directories: [
|
include_directories: [
|
||||||
openxr_include,
|
openxr_include,
|
||||||
st_include, # Sigh debian meson requires this.
|
st_include, # Sigh debian meson requires this.
|
||||||
|
|
|
@ -6,6 +6,23 @@
|
||||||
* @author Jakob Bornecrantz <jakob@collabora.com>
|
* @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"
|
#include "target_lists.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -13,3 +30,5 @@ xrt_prober_create(struct xrt_prober **out_xp)
|
||||||
{
|
{
|
||||||
return xrt_prober_create_with_lists(out_xp, &target_lists);
|
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