From 502ff9200cedb7d28e922858a3f62a9a8dc6a19b Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Wed, 12 Jan 2022 18:19:19 +0100 Subject: tests/integration/usb-manager-test.cpp: Remove unneded lambda capture --- tests/integration/usb-manager-test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/usb-manager-test.cpp b/tests/integration/usb-manager-test.cpp index 392fe19..6243e92 100644 --- a/tests/integration/usb-manager-test.cpp +++ b/tests/integration/usb-manager-test.cpp @@ -1,5 +1,6 @@ /* * Copyright 2016 Canonical Ltd. + * Copyright 2022 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr + * Robert Tari */ #include @@ -203,7 +205,7 @@ TEST_F(UsbManagerFixture, USBDisconnectedDuringPrompt) notificationsSpy.clear(); } - EXPECT_TRUE(wait_for([adbd_server, N_TESTS](){return adbd_server->m_responses.size() == N_TESTS;}, 5000)); + EXPECT_TRUE(wait_for([adbd_server](){return adbd_server->m_responses.size() == N_TESTS;}, 5000)); EXPECT_EQ(expected_responses, adbd_server->m_responses); } -- cgit v1.2.3 From 20b381726943b11acc852f7de179005d221ec9fd Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Wed, 12 Jan 2022 18:20:43 +0100 Subject: CMakeLists.txt: Clean up compilation flags --- CMakeLists.txt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d5ca89..63b4d29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,13 @@ else() endif() if(ENABLE_WERROR) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + add_definitions("-Werror") +endif() + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_definitions("-Weverything") +elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_definitions("-Wall") endif() set(CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") @@ -79,15 +84,7 @@ include_directories (SYSTEM ## include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -# set the compiler warnings -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - list(APPEND CXX_WARNING_ARGS -Weverything -Wno-c++98-compat -Wno-padded) -elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - list(APPEND CXX_WARNING_ARGS -Wall -Wextra -Wpedantic) -endif() - -add_compile_options(-std=c++14 -fPIC) +add_compile_options(-fPIC) add_subdirectory(src) add_subdirectory(data) -- cgit v1.2.3 From 7ba756aa76ad0d1d645f904cac54d0f6cefe67d0 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Wed, 12 Jan 2022 18:23:58 +0100 Subject: .build.yml: Drop extra compilation flags and build with -Werror --- .build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.build.yml b/.build.yml index 133fb10..46aead6 100644 --- a/.build.yml +++ b/.build.yml @@ -142,15 +142,14 @@ before_scripts: build_scripts: - if [ ${DISTRO_NAME} == "debian" ];then - - export CFLAGS+=" -Wsign-compare -Wunused-parameter" - cppcheck --enable=warning,style,performance,portability,information,missingInclude . - fi - - if [ -e ./CMakeLists.txt ]; then - if [ ${DISTRO_NAME} == "debian" ] || [ ${DISTRO_NAME} == "ubuntu" ];then - - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTS=ON + - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_WERROR=ON -DENABLE_TESTS=ON - else - - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON + - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_WERROR=ON - fi - else - exit 1 -- cgit v1.2.3