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
=== modified file 'benchmarks/frame-uniformity/CMakeLists.txt'
--- benchmarks/frame-uniformity/CMakeLists.txt 2017-08-25 06:41:20 +0000
+++ benchmarks/frame-uniformity/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -28,7 +28,7 @@
28 mirserver28 mirserver
29 mirclient29 mirclient
30 mirplatform30 mirplatform
31 31
32 mir-test-assist32 mir-test-assist
3333
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)
@@ -39,7 +39,6 @@
3939
40 ${Boost_LIBRARIES}40 ${Boost_LIBRARIES}
41 ${GTEST_BOTH_LIBRARIES}41 ${GTEST_BOTH_LIBRARIES}
42 ${GMOCK_LIBRARY}42 ${GMOCK_LIBRARIES}
43 ${GMOCK_MAIN_LIBRARY}
44 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.43 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
45)44)
4645
=== modified file 'cmake/FindGtestGmock.cmake'
--- cmake/FindGtestGmock.cmake 2017-09-07 05:58:13 +0000
+++ cmake/FindGtestGmock.cmake 2017-10-16 15:39:57 +0000
@@ -1,6 +1,12 @@
1include(ExternalProject)1include(ExternalProject)
2include(FindPackageHandleStandardArgs)2include(FindPackageHandleStandardArgs)
33
4if (NOT MIR_CHROOT)
5 find_package(GMock REQUIRED)
6 if (NOT TARGET GMock)
7 add_custom_target(GMock DEPENDS gmock)
8 endif()
9else()
4#10#
5# When cross compiling MIR_CHROOT points to our chroot.11# When cross compiling MIR_CHROOT points to our chroot.
6# When not cross compiling, it should be blank to use the host system.12# When not cross compiling, it should be blank to use the host system.
@@ -89,8 +95,9 @@
89set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)95set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
90set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)96set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
91set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})97set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
92set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})98set(GMOCK_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
9399
94find_package_handle_standard_args(GTest DEFAULT_MSG100find_package_handle_standard_args(GTest DEFAULT_MSG
95 GMOCK_INCLUDE_DIR101 GMOCK_INCLUDE_DIR
96 GTEST_INCLUDE_DIR)102 GTEST_INCLUDE_DIR)
103endif()
97104
=== modified file 'debian/control'
--- debian/control 2017-10-11 15:49:20 +0000
+++ debian/control 2017-10-16 15:39:57 +0000
@@ -4,6 +4,7 @@
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com>5XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com>
6Build-Depends: cmake,6Build-Depends: cmake,
7 cmake-extras,
7 pkg-config,8 pkg-config,
8 debhelper (>= 9),9 debhelper (>= 9),
9 doxygen,10 doxygen,
1011
=== modified file 'examples/CMakeLists.txt'
--- examples/CMakeLists.txt 2017-09-07 05:58:13 +0000
+++ examples/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -279,7 +279,7 @@
279mir_add_wrapped_executable(mir_demo_client_wayland wayland_client.c)279mir_add_wrapped_executable(mir_demo_client_wayland wayland_client.c)
280target_link_libraries(mir_demo_client_wayland280target_link_libraries(mir_demo_client_wayland
281281
282 ${WAYLAND_CLIENT_LIBRARIES}282 ${WAYLAND_CLIENT_LDFLAGS} ${WAYLAND_CLIENT_LIBRARIES}
283)283)
284284
285mir_add_wrapped_executable(mir_demo_client_screencast screencast.cpp)285mir_add_wrapped_executable(mir_demo_client_screencast screencast.cpp)
286286
=== modified file 'examples/miral-kiosk/CMakeLists.txt'
--- examples/miral-kiosk/CMakeLists.txt 2017-08-31 15:12:09 +0000
+++ examples/miral-kiosk/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -10,3 +10,8 @@
10)10)
1111
12target_link_libraries(miral-kiosk miral)12target_link_libraries(miral-kiosk miral)
13
14# I'm not sure why this is needed in a chroot, but it's not worth finding out
15if(DEFINED MIR_CHROOT)
16 target_link_libraries(miral-kiosk EGL ${GLESv2_LIBRARIES})
17endif()
1318
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
+++ tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -109,9 +109,9 @@
109 mir-test-doubles-platform-static109 mir-test-doubles-platform-static
110 ${Boost_LIBRARIES}110 ${Boost_LIBRARIES}
111 ${GTEST_BOTH_LIBRARIES}111 ${GTEST_BOTH_LIBRARIES}
112 ${GMOCK_LIBRARY}
113PRIVATE112PRIVATE
114 ${GMOCK_MAIN_LIBRARY}113 ${GMOCK_MAIN_LIBRARY}
114 ${GMOCK_LIBRARIES}
115 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.115 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
116)116)
117117
118118
=== modified file 'tests/integration-tests/CMakeLists.txt'
--- tests/integration-tests/CMakeLists.txt 2017-08-25 06:41:20 +0000
+++ tests/integration-tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -69,8 +69,7 @@
6969
70 ${Boost_LIBRARIES}70 ${Boost_LIBRARIES}
71 ${GTEST_BOTH_LIBRARIES}71 ${GTEST_BOTH_LIBRARIES}
72 ${GMOCK_LIBRARY}72 ${GMOCK_LIBRARIES}
73 ${GMOCK_MAIN_LIBRARY}
74 # Mesa platform dependencies73 # Mesa platform dependencies
75 ${DRM_LDFLAGS} ${DRM_LIBRARIES}74 ${DRM_LDFLAGS} ${DRM_LIBRARIES}
76 ${GBM_LDFLAGS} ${GBM_LIBRARIES}75 ${GBM_LDFLAGS} ${GBM_LIBRARIES}
7776
=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
--- tests/mir_test_doubles/CMakeLists.txt 2017-08-25 06:41:20 +0000
+++ tests/mir_test_doubles/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -86,7 +86,7 @@
86 mirserver86 mirserver
8787
88 ${Boost_LIBRARIES}88 ${Boost_LIBRARIES}
89 ${GMOCK_LIBRARY}89 ${GMOCK_LIBRARIES}
90 ${GMOCK_MAIN_LIBRARY}90 ${GMOCK_MAIN_LIBRARY}
91 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.91 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
92)92)
@@ -104,7 +104,7 @@
104 mir-test-doubles-platform-static104 mir-test-doubles-platform-static
105105
106 -ldl106 -ldl
107 ${GMOCK_LIBRARY}107 ${GMOCK_LIBRARIES}
108 ${GMOCK_MAIN_LIBRARY}108 ${GMOCK_MAIN_LIBRARY}
109 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.109 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
110)110)
111111
=== modified file 'tests/mir_test_framework/CMakeLists.txt'
--- tests/mir_test_framework/CMakeLists.txt 2017-09-25 13:39:41 +0000
+++ tests/mir_test_framework/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -85,11 +85,11 @@
8585
86target_link_libraries(mir-test-framework-static86target_link_libraries(mir-test-framework-static
8787
88 mirserver
88 mirclient89 mirclient
89 ${Boost_LIBRARIES}90 ${Boost_LIBRARIES}
90 ${GTEST_BOTH_LIBRARIES}91 ${GTEST_BOTH_LIBRARIES}
91 ${GMOCK_LIBRARY}92 ${GMOCK_LIBRARIES}
92 ${GMOCK_MAIN_LIBRARY}
93 ${UMOCKDEV_LIBRARIES}93 ${UMOCKDEV_LIBRARIES}
94 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.94 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
95)95)
9696
=== modified file 'tests/performance-tests/CMakeLists.txt'
--- tests/performance-tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
+++ tests/performance-tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -28,8 +28,8 @@
28 test_compositor.cpp28 test_compositor.cpp
29)29)
30target_link_libraries(mir_compositor_performance_test30target_link_libraries(mir_compositor_performance_test
31 mir_system_performance_test
31 ${GTEST_BOTH_LIBRARIES}32 ${GTEST_BOTH_LIBRARIES}
32 mir_system_performance_test
33)33)
3434
35mir_add_wrapped_executable(mir_client_startup_performance_test35mir_add_wrapped_executable(mir_client_startup_performance_test
3636
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2017-09-07 05:58:13 +0000
+++ tests/unit-tests/CMakeLists.txt 2017-10-16 15:39:57 +0000
@@ -136,8 +136,7 @@
136136
137 ${PROTOBUF_LITE_LIBRARIES}137 ${PROTOBUF_LITE_LIBRARIES}
138 ${GTEST_BOTH_LIBRARIES}138 ${GTEST_BOTH_LIBRARIES}
139 ${GMOCK_LIBRARY}139 ${GMOCK_LIBRARIES}
140 ${GMOCK_MAIN_LIBRARY}
141 ${Boost_LIBRARIES}140 ${Boost_LIBRARIES}
142 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.141 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
143)142)
@@ -176,8 +175,7 @@
176175
177 ${PROTOBUF_LITE_LIBRARIES}176 ${PROTOBUF_LITE_LIBRARIES}
178 ${GTEST_BOTH_LIBRARIES}177 ${GTEST_BOTH_LIBRARIES}
179 ${GMOCK_LIBRARY}178 ${GMOCK_LIBRARIES}
180 ${GMOCK_MAIN_LIBRARY}
181 ${Boost_LIBRARIES}179 ${Boost_LIBRARIES}
182 ${UMOCKDEV_LIBRARIES}180 ${UMOCKDEV_LIBRARIES}
183 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.181 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
184182
=== modified file 'tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp'
--- tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-08-25 06:41:20 +0000
+++ tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-10-16 15:39:57 +0000
@@ -155,7 +155,7 @@
155 auto edid_size = mir_output_get_edid_size(output);155 auto edid_size = mir_output_get_edid_size(output);
156156
157 ASSERT_NE(nullptr, edid_start);157 ASSERT_NE(nullptr, edid_start);
158 ASSERT_NE(0, edid_size);158 ASSERT_NE(0u, edid_size);
159159
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);
161161

Subscribers

People subscribed via source and target branches