From 63ff7da38a12e460dffc88e9c91682633f5be3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Vo=C3=9F?= Date: Wed, 12 Apr 2017 13:12:04 +0200 Subject: [PATCH 1/4] Fix compilation on 17.04. --- CMakeLists.txt | 9 ++------- src/anbox/bridge/platform_api_skeleton.cpp | 2 ++ src/anbox/common/small_vector.h | 1 + tests/CMakeLists.txt | 6 ++++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 328aec3..957664b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ set(C_AND_CXX_WARNINGS "-pedantic -Wall -Wextra") # Some additional warnings not included by the general flags set above. set(EXTRA_C_WARNINGS "-Wcast-align -Wcast-qual -Wformat -Wredundant-decls -Wswitch-default") -set(EXTRA_CXX_WARNINGS "-Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast") +set(EXTRA_CXX_WARNINGS "-Wnon-virtual-dtor -Wold-style-cast") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_AND_CXX_WARNINGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_WARNINGS}") @@ -87,12 +87,7 @@ IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE]) SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" ) ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE]) -# Build with system gmock and embedded gtest -set (GMOCK_INCLUDE_DIR "/usr/include/gmock/include" CACHE PATH "gmock source include directory") -set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory") -set (GTEST_INCLUDE_DIR "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory") - -add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock") +find_package(GMock) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC") diff --git a/src/anbox/bridge/platform_api_skeleton.cpp b/src/anbox/bridge/platform_api_skeleton.cpp index c8eb9e2..671ab3d 100644 --- a/src/anbox/bridge/platform_api_skeleton.cpp +++ b/src/anbox/bridge/platform_api_skeleton.cpp @@ -22,6 +22,8 @@ #include "anbox/wm/window_state.h" #include "anbox/logger.h" +#undef Status + #include "anbox_bridge.pb.h" namespace anbox { diff --git a/src/anbox/common/small_vector.h b/src/anbox/common/small_vector.h index 5193b1f..74f5f0d 100644 --- a/src/anbox/common/small_vector.h +++ b/src/anbox/common/small_vector.h @@ -15,6 +15,7 @@ #include #include +#include #include #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 37329ed..f9b17a8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare") + include_directories( ${Boost_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} @@ -16,8 +18,8 @@ macro(ANBOX_ADD_TEST test_name src) anbox-core - gmock - gmock_main + ${GMOCK_LIBRARIES} + ${GTEST_BOTH_LIBRARIES} ${ARGN} From 5cf5ed37e467838a3c7b1493d0ce01b51b61a6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Vo=C3=9F?= Date: Wed, 12 Apr 2017 13:28:35 +0200 Subject: [PATCH 2/4] Only conditionally undef Status --- src/anbox/bridge/platform_api_skeleton.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/anbox/bridge/platform_api_skeleton.cpp b/src/anbox/bridge/platform_api_skeleton.cpp index 671ab3d..10fe227 100644 --- a/src/anbox/bridge/platform_api_skeleton.cpp +++ b/src/anbox/bridge/platform_api_skeleton.cpp @@ -22,7 +22,9 @@ #include "anbox/wm/window_state.h" #include "anbox/logger.h" +#if defined(Status) #undef Status +#endif // defined(Status) #include "anbox_bridge.pb.h" From c5f1cc66b743e9fa43e6e2146ea22a1bb9dab945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Vo=C3=9F?= Date: Wed, 12 Apr 2017 13:44:51 +0200 Subject: [PATCH 3/4] Add cmake-extras as build dependency --- packaging/snap/snapcraft.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/snap/snapcraft.yaml b/packaging/snap/snapcraft.yaml index 7c4fac0..364b265 100644 --- a/packaging/snap/snapcraft.yaml +++ b/packaging/snap/snapcraft.yaml @@ -84,6 +84,7 @@ parts: - build-essential - cmake - cmake-data + - cmake-extras - debhelper - dbus - google-mock From 74330e4efa86f57934040f2ab4d8420a016e6eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Vo=C3=9F?= Date: Wed, 12 Apr 2017 14:14:25 +0200 Subject: [PATCH 4/4] Add cmake-extras to clean-build --- scripts/clean-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/clean-build.sh b/scripts/clean-build.sh index 516863a..e6f6d75 100755 --- a/scripts/clean-build.sh +++ b/scripts/clean-build.sh @@ -7,6 +7,7 @@ apt-get install -qq -y \ build-essential \ cmake \ cmake-data \ + cmake-extras \ debhelper \ dbus \ git \