Mir

Merge lp:~alan-griffiths/mir/fix-gmock-detection into lp:mir

Proposed by Alan Griffiths on 2017-10-16
Status: Superseded
Proposed branch: lp:~alan-griffiths/mir/fix-gmock-detection
Merge into: lp:mir
Diff against target: 206 lines (+27/-18)
12 files modified
benchmarks/frame-uniformity/CMakeLists.txt (+2/-3)
cmake/FindGtestGmock.cmake (+8/-1)
debian/control (+1/-0)
examples/CMakeLists.txt (+1/-1)
examples/miral-kiosk/CMakeLists.txt (+5/-0)
tests/CMakeLists.txt (+1/-1)
tests/integration-tests/CMakeLists.txt (+1/-2)
tests/mir_test_doubles/CMakeLists.txt (+2/-2)
tests/mir_test_framework/CMakeLists.txt (+2/-2)
tests/performance-tests/CMakeLists.txt (+1/-1)
tests/unit-tests/CMakeLists.txt (+2/-4)
tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp (+1/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-gmock-detection
Reviewer Review Type Date Requested Status
Mir development team 2017-10-16 Pending
Mir CI Bot continuous-integration 2017-10-16 Pending
Review via email: mp+332305@code.launchpad.net

This proposal has been superseded by a proposal from 2017-10-16.

Commit message

Fix gmock detection in cmake.

At some point since xenial cmake-extras gained a script for finding gmock and gtest. We can use that for most build platforms.

To post a comment you must log in.
4293. By Alan Griffiths on 2017-10-17

Add another way of detecting cross compilation (and some debug messages)

4294. By Alan Griffiths on 2017-10-17

merge :parent

4295. By Alan Griffiths on 2017-10-17

Remove debug messages and simplify logic

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'benchmarks/frame-uniformity/CMakeLists.txt'
2--- benchmarks/frame-uniformity/CMakeLists.txt 2017-08-25 06:41:20 +0000
3+++ benchmarks/frame-uniformity/CMakeLists.txt 2017-10-16 15:39:57 +0000
4@@ -28,7 +28,7 @@
5 mirserver
6 mirclient
7 mirplatform
8-
9+
10 mir-test-assist
11
12 # needed for fake_event_hub_server_configuration.h (which relies on private APIs)
13@@ -39,7 +39,6 @@
14
15 ${Boost_LIBRARIES}
16 ${GTEST_BOTH_LIBRARIES}
17- ${GMOCK_LIBRARY}
18- ${GMOCK_MAIN_LIBRARY}
19+ ${GMOCK_LIBRARIES}
20 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
21 )
22
23=== modified file 'cmake/FindGtestGmock.cmake'
24--- cmake/FindGtestGmock.cmake 2017-09-07 05:58:13 +0000
25+++ cmake/FindGtestGmock.cmake 2017-10-16 15:39:57 +0000
26@@ -1,6 +1,12 @@
27 include(ExternalProject)
28 include(FindPackageHandleStandardArgs)
29
30+if (NOT MIR_CHROOT)
31+ find_package(GMock REQUIRED)
32+ if (NOT TARGET GMock)
33+ add_custom_target(GMock DEPENDS gmock)
34+ endif()
35+else()
36 #
37 # When cross compiling MIR_CHROOT points to our chroot.
38 # When not cross compiling, it should be blank to use the host system.
39@@ -89,8 +95,9 @@
40 set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
41 set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
42 set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
43-set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
44+set(GMOCK_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
45
46 find_package_handle_standard_args(GTest DEFAULT_MSG
47 GMOCK_INCLUDE_DIR
48 GTEST_INCLUDE_DIR)
49+endif()
50
51=== modified file 'debian/control'
52--- debian/control 2017-10-11 15:49:20 +0000
53+++ debian/control 2017-10-16 15:39:57 +0000
54@@ -4,6 +4,7 @@
55 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
56 XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com>
57 Build-Depends: cmake,
58+ cmake-extras,
59 pkg-config,
60 debhelper (>= 9),
61 doxygen,
62
63=== modified file 'examples/CMakeLists.txt'
64--- examples/CMakeLists.txt 2017-09-07 05:58:13 +0000
65+++ examples/CMakeLists.txt 2017-10-16 15:39:57 +0000
66@@ -279,7 +279,7 @@
67 mir_add_wrapped_executable(mir_demo_client_wayland wayland_client.c)
68 target_link_libraries(mir_demo_client_wayland
69
70- ${WAYLAND_CLIENT_LIBRARIES}
71+ ${WAYLAND_CLIENT_LDFLAGS} ${WAYLAND_CLIENT_LIBRARIES}
72 )
73
74 mir_add_wrapped_executable(mir_demo_client_screencast screencast.cpp)
75
76=== modified file 'examples/miral-kiosk/CMakeLists.txt'
77--- examples/miral-kiosk/CMakeLists.txt 2017-08-31 15:12:09 +0000
78+++ examples/miral-kiosk/CMakeLists.txt 2017-10-16 15:39:57 +0000
79@@ -10,3 +10,8 @@
80 )
81
82 target_link_libraries(miral-kiosk miral)
83+
84+# I'm not sure why this is needed in a chroot, but it's not worth finding out
85+if(DEFINED MIR_CHROOT)
86+ target_link_libraries(miral-kiosk EGL ${GLESv2_LIBRARIES})
87+endif()
88
89=== modified file 'tests/CMakeLists.txt'
90--- tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
91+++ tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
92@@ -109,9 +109,9 @@
93 mir-test-doubles-platform-static
94 ${Boost_LIBRARIES}
95 ${GTEST_BOTH_LIBRARIES}
96- ${GMOCK_LIBRARY}
97 PRIVATE
98 ${GMOCK_MAIN_LIBRARY}
99+ ${GMOCK_LIBRARIES}
100 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
101 )
102
103
104=== modified file 'tests/integration-tests/CMakeLists.txt'
105--- tests/integration-tests/CMakeLists.txt 2017-08-25 06:41:20 +0000
106+++ tests/integration-tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
107@@ -69,8 +69,7 @@
108
109 ${Boost_LIBRARIES}
110 ${GTEST_BOTH_LIBRARIES}
111- ${GMOCK_LIBRARY}
112- ${GMOCK_MAIN_LIBRARY}
113+ ${GMOCK_LIBRARIES}
114 # Mesa platform dependencies
115 ${DRM_LDFLAGS} ${DRM_LIBRARIES}
116 ${GBM_LDFLAGS} ${GBM_LIBRARIES}
117
118=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
119--- tests/mir_test_doubles/CMakeLists.txt 2017-08-25 06:41:20 +0000
120+++ tests/mir_test_doubles/CMakeLists.txt 2017-10-16 15:39:57 +0000
121@@ -86,7 +86,7 @@
122 mirserver
123
124 ${Boost_LIBRARIES}
125- ${GMOCK_LIBRARY}
126+ ${GMOCK_LIBRARIES}
127 ${GMOCK_MAIN_LIBRARY}
128 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
129 )
130@@ -104,7 +104,7 @@
131 mir-test-doubles-platform-static
132
133 -ldl
134- ${GMOCK_LIBRARY}
135+ ${GMOCK_LIBRARIES}
136 ${GMOCK_MAIN_LIBRARY}
137 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
138 )
139
140=== modified file 'tests/mir_test_framework/CMakeLists.txt'
141--- tests/mir_test_framework/CMakeLists.txt 2017-09-25 13:39:41 +0000
142+++ tests/mir_test_framework/CMakeLists.txt 2017-10-16 15:39:57 +0000
143@@ -85,11 +85,11 @@
144
145 target_link_libraries(mir-test-framework-static
146
147+ mirserver
148 mirclient
149 ${Boost_LIBRARIES}
150 ${GTEST_BOTH_LIBRARIES}
151- ${GMOCK_LIBRARY}
152- ${GMOCK_MAIN_LIBRARY}
153+ ${GMOCK_LIBRARIES}
154 ${UMOCKDEV_LIBRARIES}
155 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
156 )
157
158=== modified file 'tests/performance-tests/CMakeLists.txt'
159--- tests/performance-tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
160+++ tests/performance-tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
161@@ -28,8 +28,8 @@
162 test_compositor.cpp
163 )
164 target_link_libraries(mir_compositor_performance_test
165+ mir_system_performance_test
166 ${GTEST_BOTH_LIBRARIES}
167- mir_system_performance_test
168 )
169
170 mir_add_wrapped_executable(mir_client_startup_performance_test
171
172=== modified file 'tests/unit-tests/CMakeLists.txt'
173--- tests/unit-tests/CMakeLists.txt 2017-09-07 05:58:13 +0000
174+++ tests/unit-tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
175@@ -136,8 +136,7 @@
176
177 ${PROTOBUF_LITE_LIBRARIES}
178 ${GTEST_BOTH_LIBRARIES}
179- ${GMOCK_LIBRARY}
180- ${GMOCK_MAIN_LIBRARY}
181+ ${GMOCK_LIBRARIES}
182 ${Boost_LIBRARIES}
183 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
184 )
185@@ -176,8 +175,7 @@
186
187 ${PROTOBUF_LITE_LIBRARIES}
188 ${GTEST_BOTH_LIBRARIES}
189- ${GMOCK_LIBRARY}
190- ${GMOCK_MAIN_LIBRARY}
191+ ${GMOCK_LIBRARIES}
192 ${Boost_LIBRARIES}
193 ${UMOCKDEV_LIBRARIES}
194 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
195
196=== modified file 'tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp'
197--- tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-08-25 06:41:20 +0000
198+++ tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-10-16 15:39:57 +0000
199@@ -155,7 +155,7 @@
200 auto edid_size = mir_output_get_edid_size(output);
201
202 ASSERT_NE(nullptr, edid_start);
203- ASSERT_NE(0, edid_size);
204+ ASSERT_NE(0u, edid_size);
205
206 std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size);
207

Subscribers

People subscribed via source and target branches