Merge lp:~alan-griffiths/mir/fix-gmock-detection into lp:mir
- fix-gmock-detection
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Alan Griffiths |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4293 |
Proposed branch: | lp:~alan-griffiths/mir/fix-gmock-detection |
Merge into: | lp:mir |
Prerequisite: | lp:~alan-griffiths/mir/fix-cross-build |
Diff against target: |
182 lines (+23/-17) 10 files modified
benchmarks/frame-uniformity/CMakeLists.txt (+2/-3) cmake/FindGtestGmock.cmake (+10/-1) debian/control (+1/-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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Approve | |
Brandon Schaefer (community) | Approve | ||
Review via email: mp+332306@code.launchpad.net |
This proposal supersedes 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.
Description of the change
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4292
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4294
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4295
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) : | # |
Preview Diff
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-17 09:33:43 +0000 | |||
4 | @@ -28,7 +28,7 @@ | |||
5 | 28 | mirserver | 28 | mirserver |
6 | 29 | mirclient | 29 | mirclient |
7 | 30 | mirplatform | 30 | mirplatform |
9 | 31 | 31 | ||
10 | 32 | mir-test-assist | 32 | mir-test-assist |
11 | 33 | 33 | ||
12 | 34 | # needed for fake_event_hub_server_configuration.h (which relies on private APIs) | 34 | # needed for fake_event_hub_server_configuration.h (which relies on private APIs) |
13 | @@ -39,7 +39,6 @@ | |||
14 | 39 | 39 | ||
15 | 40 | ${Boost_LIBRARIES} | 40 | ${Boost_LIBRARIES} |
16 | 41 | ${GTEST_BOTH_LIBRARIES} | 41 | ${GTEST_BOTH_LIBRARIES} |
19 | 42 | ${GMOCK_LIBRARY} | 42 | ${GMOCK_LIBRARIES} |
18 | 43 | ${GMOCK_MAIN_LIBRARY} | ||
20 | 44 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. | 43 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
21 | 45 | ) | 44 | ) |
22 | 46 | 45 | ||
23 | === modified file 'cmake/FindGtestGmock.cmake' | |||
24 | --- cmake/FindGtestGmock.cmake 2017-09-07 05:58:13 +0000 | |||
25 | +++ cmake/FindGtestGmock.cmake 2017-10-17 09:33:43 +0000 | |||
26 | @@ -1,6 +1,14 @@ | |||
27 | 1 | include(ExternalProject) | 1 | include(ExternalProject) |
28 | 2 | include(FindPackageHandleStandardArgs) | 2 | include(FindPackageHandleStandardArgs) |
29 | 3 | 3 | ||
30 | 4 | execute_process(COMMAND "arch" OUTPUT_VARIABLE MIR_HOST_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
31 | 5 | |||
32 | 6 | if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${MIR_HOST_PROCESSOR}") | ||
33 | 7 | find_package(GMock REQUIRED) | ||
34 | 8 | if (NOT TARGET GMock) | ||
35 | 9 | add_custom_target(GMock DEPENDS gmock) | ||
36 | 10 | endif() | ||
37 | 11 | else() | ||
38 | 4 | # | 12 | # |
39 | 5 | # When cross compiling MIR_CHROOT points to our chroot. | 13 | # When cross compiling MIR_CHROOT points to our chroot. |
40 | 6 | # When not cross compiling, it should be blank to use the host system. | 14 | # When not cross compiling, it should be blank to use the host system. |
41 | @@ -89,8 +97,9 @@ | |||
42 | 89 | set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a) | 97 | set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a) |
43 | 90 | set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a) | 98 | set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a) |
44 | 91 | set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY}) | 99 | set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY}) |
46 | 92 | set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES}) | 100 | set(GMOCK_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES}) |
47 | 93 | 101 | ||
48 | 94 | find_package_handle_standard_args(GTest DEFAULT_MSG | 102 | find_package_handle_standard_args(GTest DEFAULT_MSG |
49 | 95 | GMOCK_INCLUDE_DIR | 103 | GMOCK_INCLUDE_DIR |
50 | 96 | GTEST_INCLUDE_DIR) | 104 | GTEST_INCLUDE_DIR) |
51 | 105 | endif() | ||
52 | 97 | 106 | ||
53 | === modified file 'debian/control' | |||
54 | --- debian/control 2017-10-11 15:49:20 +0000 | |||
55 | +++ debian/control 2017-10-17 09:33:43 +0000 | |||
56 | @@ -4,6 +4,7 @@ | |||
57 | 4 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> | 4 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
58 | 5 | XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com> | 5 | XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com> |
59 | 6 | Build-Depends: cmake, | 6 | Build-Depends: cmake, |
60 | 7 | cmake-extras, | ||
61 | 7 | pkg-config, | 8 | pkg-config, |
62 | 8 | debhelper (>= 9), | 9 | debhelper (>= 9), |
63 | 9 | doxygen, | 10 | doxygen, |
64 | 10 | 11 | ||
65 | === modified file 'tests/CMakeLists.txt' | |||
66 | --- tests/CMakeLists.txt 2017-09-18 10:57:00 +0000 | |||
67 | +++ tests/CMakeLists.txt 2017-10-17 09:33:43 +0000 | |||
68 | @@ -109,9 +109,9 @@ | |||
69 | 109 | mir-test-doubles-platform-static | 109 | mir-test-doubles-platform-static |
70 | 110 | ${Boost_LIBRARIES} | 110 | ${Boost_LIBRARIES} |
71 | 111 | ${GTEST_BOTH_LIBRARIES} | 111 | ${GTEST_BOTH_LIBRARIES} |
72 | 112 | ${GMOCK_LIBRARY} | ||
73 | 113 | PRIVATE | 112 | PRIVATE |
74 | 114 | ${GMOCK_MAIN_LIBRARY} | 113 | ${GMOCK_MAIN_LIBRARY} |
75 | 114 | ${GMOCK_LIBRARIES} | ||
76 | 115 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. | 115 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
77 | 116 | ) | 116 | ) |
78 | 117 | 117 | ||
79 | 118 | 118 | ||
80 | === modified file 'tests/integration-tests/CMakeLists.txt' | |||
81 | --- tests/integration-tests/CMakeLists.txt 2017-08-25 06:41:20 +0000 | |||
82 | +++ tests/integration-tests/CMakeLists.txt 2017-10-17 09:33:43 +0000 | |||
83 | @@ -69,8 +69,7 @@ | |||
84 | 69 | 69 | ||
85 | 70 | ${Boost_LIBRARIES} | 70 | ${Boost_LIBRARIES} |
86 | 71 | ${GTEST_BOTH_LIBRARIES} | 71 | ${GTEST_BOTH_LIBRARIES} |
89 | 72 | ${GMOCK_LIBRARY} | 72 | ${GMOCK_LIBRARIES} |
88 | 73 | ${GMOCK_MAIN_LIBRARY} | ||
90 | 74 | # Mesa platform dependencies | 73 | # Mesa platform dependencies |
91 | 75 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} | 74 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
92 | 76 | ${GBM_LDFLAGS} ${GBM_LIBRARIES} | 75 | ${GBM_LDFLAGS} ${GBM_LIBRARIES} |
93 | 77 | 76 | ||
94 | === modified file 'tests/mir_test_doubles/CMakeLists.txt' | |||
95 | --- tests/mir_test_doubles/CMakeLists.txt 2017-08-25 06:41:20 +0000 | |||
96 | +++ tests/mir_test_doubles/CMakeLists.txt 2017-10-17 09:33:43 +0000 | |||
97 | @@ -86,7 +86,7 @@ | |||
98 | 86 | mirserver | 86 | mirserver |
99 | 87 | 87 | ||
100 | 88 | ${Boost_LIBRARIES} | 88 | ${Boost_LIBRARIES} |
102 | 89 | ${GMOCK_LIBRARY} | 89 | ${GMOCK_LIBRARIES} |
103 | 90 | ${GMOCK_MAIN_LIBRARY} | 90 | ${GMOCK_MAIN_LIBRARY} |
104 | 91 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. | 91 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
105 | 92 | ) | 92 | ) |
106 | @@ -104,7 +104,7 @@ | |||
107 | 104 | mir-test-doubles-platform-static | 104 | mir-test-doubles-platform-static |
108 | 105 | 105 | ||
109 | 106 | -ldl | 106 | -ldl |
111 | 107 | ${GMOCK_LIBRARY} | 107 | ${GMOCK_LIBRARIES} |
112 | 108 | ${GMOCK_MAIN_LIBRARY} | 108 | ${GMOCK_MAIN_LIBRARY} |
113 | 109 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. | 109 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
114 | 110 | ) | 110 | ) |
115 | 111 | 111 | ||
116 | === modified file 'tests/mir_test_framework/CMakeLists.txt' | |||
117 | --- tests/mir_test_framework/CMakeLists.txt 2017-09-25 13:39:41 +0000 | |||
118 | +++ tests/mir_test_framework/CMakeLists.txt 2017-10-17 09:33:43 +0000 | |||
119 | @@ -85,11 +85,11 @@ | |||
120 | 85 | 85 | ||
121 | 86 | target_link_libraries(mir-test-framework-static | 86 | target_link_libraries(mir-test-framework-static |
122 | 87 | 87 | ||
123 | 88 | mirserver | ||
124 | 88 | mirclient | 89 | mirclient |
125 | 89 | ${Boost_LIBRARIES} | 90 | ${Boost_LIBRARIES} |
126 | 90 | ${GTEST_BOTH_LIBRARIES} | 91 | ${GTEST_BOTH_LIBRARIES} |
129 | 91 | ${GMOCK_LIBRARY} | 92 | ${GMOCK_LIBRARIES} |
128 | 92 | ${GMOCK_MAIN_LIBRARY} | ||
130 | 93 | ${UMOCKDEV_LIBRARIES} | 93 | ${UMOCKDEV_LIBRARIES} |
131 | 94 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. | 94 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
132 | 95 | ) | 95 | ) |
133 | 96 | 96 | ||
134 | === modified file 'tests/performance-tests/CMakeLists.txt' | |||
135 | --- tests/performance-tests/CMakeLists.txt 2017-09-18 10:57:00 +0000 | |||
136 | +++ tests/performance-tests/CMakeLists.txt 2017-10-17 09:33:43 +0000 | |||
137 | @@ -28,8 +28,8 @@ | |||
138 | 28 | test_compositor.cpp | 28 | test_compositor.cpp |
139 | 29 | ) | 29 | ) |
140 | 30 | target_link_libraries(mir_compositor_performance_test | 30 | target_link_libraries(mir_compositor_performance_test |
141 | 31 | mir_system_performance_test | ||
142 | 31 | ${GTEST_BOTH_LIBRARIES} | 32 | ${GTEST_BOTH_LIBRARIES} |
143 | 32 | mir_system_performance_test | ||
144 | 33 | ) | 33 | ) |
145 | 34 | 34 | ||
146 | 35 | mir_add_wrapped_executable(mir_client_startup_performance_test | 35 | mir_add_wrapped_executable(mir_client_startup_performance_test |
147 | 36 | 36 | ||
148 | === modified file 'tests/unit-tests/CMakeLists.txt' | |||
149 | --- tests/unit-tests/CMakeLists.txt 2017-09-07 05:58:13 +0000 | |||
150 | +++ tests/unit-tests/CMakeLists.txt 2017-10-17 09:33:43 +0000 | |||
151 | @@ -136,8 +136,7 @@ | |||
152 | 136 | 136 | ||
153 | 137 | ${PROTOBUF_LITE_LIBRARIES} | 137 | ${PROTOBUF_LITE_LIBRARIES} |
154 | 138 | ${GTEST_BOTH_LIBRARIES} | 138 | ${GTEST_BOTH_LIBRARIES} |
157 | 139 | ${GMOCK_LIBRARY} | 139 | ${GMOCK_LIBRARIES} |
156 | 140 | ${GMOCK_MAIN_LIBRARY} | ||
158 | 141 | ${Boost_LIBRARIES} | 140 | ${Boost_LIBRARIES} |
159 | 142 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. | 141 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
160 | 143 | ) | 142 | ) |
161 | @@ -176,8 +175,7 @@ | |||
162 | 176 | 175 | ||
163 | 177 | ${PROTOBUF_LITE_LIBRARIES} | 176 | ${PROTOBUF_LITE_LIBRARIES} |
164 | 178 | ${GTEST_BOTH_LIBRARIES} | 177 | ${GTEST_BOTH_LIBRARIES} |
167 | 179 | ${GMOCK_LIBRARY} | 178 | ${GMOCK_LIBRARIES} |
166 | 180 | ${GMOCK_MAIN_LIBRARY} | ||
168 | 181 | ${Boost_LIBRARIES} | 179 | ${Boost_LIBRARIES} |
169 | 182 | ${UMOCKDEV_LIBRARIES} | 180 | ${UMOCKDEV_LIBRARIES} |
170 | 183 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. | 181 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
171 | 184 | 182 | ||
172 | === modified file 'tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp' | |||
173 | --- tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-08-25 06:41:20 +0000 | |||
174 | +++ tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-10-17 09:33:43 +0000 | |||
175 | @@ -155,7 +155,7 @@ | |||
176 | 155 | auto edid_size = mir_output_get_edid_size(output); | 155 | auto edid_size = mir_output_get_edid_size(output); |
177 | 156 | 156 | ||
178 | 157 | ASSERT_NE(nullptr, edid_start); | 157 | ASSERT_NE(nullptr, edid_start); |
180 | 158 | ASSERT_NE(0, edid_size); | 158 | ASSERT_NE(0u, edid_size); |
181 | 159 | 159 | ||
182 | 160 | std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size); | 160 | std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size); |
183 | 161 | 161 |
Huh thought I did this with mir a bit ago. But yeah lgtm as this is much easier then manually having to keep track our selfs!