~thomas-voss/location-service/fix-1347887

« back to all changes in this revision

Viewing changes to src/location_service/com/ubuntu/location/CMakeLists.txt

This MP consolidates multiple related changes together, with the goal of:

(1.) Make the service instance accessible via a cli. Useful for testing scenarios.
(2.) To cut down time-to-first-fix (ttff) by:
  (2.1) Leveraging SUPL and other supplementary data downloaded over ordinary data connections.
  (2.2) Enabling network-based positioning providers to acquire fast position estimates.

In more detail:

* Added tests for daemon and cli.
* Unified daemon and cli header and implementation files.
* Add a command-line interface to the service.
* Split up provider selection policy to rely on an interface ProviderEnumerator to ease in testing.
* Trimmed down on types.
* Removed connectivity API draft to prepare for simpler approach.
* Refactored includes.
* Added a configuration option to handle cell and wifi ID reporting.
* Add a mock for a connectivity API exposed to providers and reporters.
* Add units for connectivity api.
* Refactor cell class into namespace radio. Fixes: 1226204, 1248973, 1281817

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
if (NET_CPP_FOUND AND JSONCPP_FOUND)
 
2
  add_definitions(-DCOM_UBUNTU_LOCATION_SERVICE_HAVE_NET_CPP=1)
 
3
  add_definitions(-DCOM_UBUNTU_LOCATION_SERVICE_HAVE_JSON_CPP=1)
 
4
 
 
5
  set(ICHNAEA_REPORTER_SRCS service/ichnaea_reporter.cpp)
 
6
endif()
 
7
 
1
8
add_subdirectory(providers)
2
9
 
3
10
add_library(
4
11
  ubuntu-location-service SHARED
5
12
 
 
13
  ${UBUNTU_LOCATION_SERVICE_PUBLIC_HEADERS}
 
14
 
6
15
  default_provider_selection_policy.cpp
7
16
  
 
17
  criteria.cpp
8
18
  engine.cpp
9
19
  init_and_shutdown.cpp
10
20
  position.cpp
11
21
  provider.cpp
12
22
  provider_factory.cpp
13
23
  proxy_provider.cpp
 
24
  set_name_for_thread.cpp
14
25
 
15
26
  service/default_configuration.cpp
16
27
  service/default_permission_manager.cpp
 
28
  service/harvester.cpp
 
29
 
17
30
  service/implementation.cpp
18
31
  service/skeleton.cpp
19
32
  service/stub.cpp
24
37
  service/session/stub.cpp
25
38
 
26
39
  providers/config.cpp
27
 
)
 
40
 
 
41
  ${ICHNAEA_REPORTER_SRCS}
 
42
)
 
43
 
 
44
add_library(
 
45
  ubuntu-location-service-connectivity SHARED
 
46
 
 
47
  set_name_for_thread.cpp
 
48
 
 
49
  connectivity/radio_cell.cpp
 
50
  connectivity/wireless_network.cpp
 
51
  connectivity/ofono_nm_connectivity_manager.cpp
 
52
)
 
53
 
 
54
set(symbol_map "${CMAKE_SOURCE_DIR}/symbols.map")
28
55
 
29
56
set_target_properties(
30
57
  ubuntu-location-service
31
58
 
32
59
  PROPERTIES
 
60
  LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}"
 
61
  LINK_DEPENDS ${symbol_map}
 
62
  VERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR}.${UBUNTU_LOCATION_SERVICE_VERSION_MINOR}.${UBUNTU_LOCATION_SERVICE_VERSION_PATCH}
 
63
  SOVERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR}
 
64
)
 
65
 
 
66
set_target_properties(
 
67
  ubuntu-location-service-connectivity
 
68
 
 
69
  PROPERTIES
 
70
  LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}"
 
71
  LINK_DEPENDS ${symbol_map}
33
72
  VERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR}.${UBUNTU_LOCATION_SERVICE_VERSION_MINOR}.${UBUNTU_LOCATION_SERVICE_VERSION_PATCH}
34
73
  SOVERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR}
35
74
)
37
76
add_definitions(${ENABLED_PROVIDER_TARGETS_DEFINITIONS})
38
77
 
39
78
target_link_libraries(
 
79
  ubuntu-location-service-connectivity
 
80
 
 
81
  ${CMAKE_THREAD_LIBS_INIT}
 
82
  ${Boost_LIBRARIES}
 
83
  ${DBUS_LIBRARIES}
 
84
  ${DBUS_CPP_LDFLAGS}
 
85
  ${PROCESS_CPP_LDFLAGS}
 
86
  ${GLog_LIBRARY}
 
87
  ${GFlags_LIBRARY}
 
88
)
 
89
 
 
90
target_link_libraries(
40
91
  ubuntu-location-service
41
92
 
 
93
  ubuntu-location-service-connectivity
 
94
 
42
95
  ${ENABLED_PROVIDER_TARGETS}
43
96
 
 
97
  ${CMAKE_THREAD_LIBS_INIT}
44
98
  ${Boost_LIBRARIES}
45
99
  ${DBUS_LIBRARIES}
46
100
  ${DBUS_CPP_LDFLAGS}
 
101
  ${JSON_CPP_LDFLAGS}
 
102
  ${NET_CPP_LDFLAGS}
47
103
  ${GLog_LIBRARY}
48
104
  ${GFlags_LIBRARY}
49
105
)
53
109
  DESTINATION ${CMAKE_INSTALL_LIBDIR}
54
110
)
55
111
 
 
112
install(
 
113
  TARGETS ubuntu-location-service-connectivity
 
114
  DESTINATION ${CMAKE_INSTALL_LIBDIR}
 
115
)
 
116
 
 
117
add_library(
 
118
  ubuntu-location-service-daemon
 
119
 
 
120
  service/daemon.cpp
 
121
)
 
122
 
56
123
add_executable(
57
124
  ubuntu-location-serviced
58
125
 
59
 
  service/main.cpp
 
126
  service/daemon_main.cpp
 
127
)
 
128
 
 
129
add_executable(
 
130
  ubuntu-location-serviced-cli
 
131
 
 
132
  service/daemon_cli_main.cpp
60
133
)
61
134
 
62
135
target_link_libraries(
63
 
  ubuntu-location-serviced
 
136
  ubuntu-location-service-daemon
64
137
 
65
138
  ubuntu-location-service
66
 
 
67
 
  ${ENABLED_PROVIDER_TARGETS}
68
 
 
69
 
  ${Boost_LIBRARIES}
70
 
  ${DBUS_LIBRARIES}
 
139
)
 
140
 
 
141
target_link_libraries(
 
142
  ubuntu-location-serviced
 
143
 
 
144
  ubuntu-location-service-daemon
 
145
 
 
146
  ${ENABLED_PROVIDER_TARGETS}
 
147
 
 
148
  ${Boost_LIBRARIES}
 
149
  ${DBUS_LIBRARIES}
 
150
  ${DBUS_CPP_LIBRARIES}
 
151
  ${GLog_LIBRARY}
 
152
  ${GFlags_LIBRARY}
 
153
)
 
154
 
 
155
target_link_libraries(
 
156
  ubuntu-location-serviced-cli
 
157
 
 
158
  ubuntu-location-service-daemon
 
159
 
 
160
  ${ENABLED_PROVIDER_TARGETS}
 
161
 
 
162
  ${Boost_LIBRARIES}
 
163
  ${DBUS_LIBRARIES}
 
164
  ${DBUS_CPP_LIBRARIES}
71
165
  ${GLog_LIBRARY}
72
166
  ${GFlags_LIBRARY}
73
167
)
77
171
  DESTINATION ${CMAKE_INSTALL_BINDIR}
78
172
)
79
173
 
 
174
install(
 
175
  TARGETS ubuntu-location-serviced-cli
 
176
  DESTINATION ${CMAKE_INSTALL_BINDIR}
 
177
)
 
178