diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-27 09:36:54 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-27 09:36:54 +0100 |
commit | f62c629fff89371af4630ebe8bc74b8075fbf52a (patch) | |
tree | 6a840d2b29bc3c0571446562218c4f9296bf73dd | |
parent | 1ea9f8bdeb14b770a98a6f33d548d51bfed72cb8 (diff) | |
parent | c77322a1155bc22862bfbbf6d8a18a2c42c3f151 (diff) | |
download | ayatana-indicator-session-f62c629fff89371af4630ebe8bc74b8075fbf52a.tar.gz ayatana-indicator-session-f62c629fff89371af4630ebe8bc74b8075fbf52a.tar.bz2 ayatana-indicator-session-f62c629fff89371af4630ebe8bc74b8075fbf52a.zip |
Merge branch 'tari01-pr/cleanup-compile-flags'
Attributes GH PR #65: https://github.com/AyatanaIndicators/ayatana-indicator-session/pull/65
-rw-r--r-- | .build.yml | 5 | ||||
-rw-r--r-- | CMakeLists.txt | 23 | ||||
-rw-r--r-- | src/service.c | 6 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/backend-dbus/CMakeLists.txt | 2 |
5 files changed, 14 insertions, 23 deletions
@@ -109,15 +109,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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dbe04d..81428f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,10 +24,17 @@ 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") +else() + add_definitions("-Wall") +endif() + +add_definitions("-Wno-sign-compare") # Needed for GTest on Ubuntu + ## ## GNU standard installation directories ## @@ -47,18 +54,6 @@ pkg_check_modules (SERVICE REQUIRED gio-unix-2.0>=2.36) include_directories (${SERVICE_INCLUDE_DIRS}) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Weverything") - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-c++98-compat -Wno-padded") - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-documentation") - -else() - - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wall") - -endif() - set (ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}) add_custom_target (dist COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz diff --git a/src/service.c b/src/service.c index 4aefb8a..25e909f 100644 --- a/src/service.c +++ b/src/service.c @@ -349,7 +349,7 @@ get_current_real_name (IndicatorSessionService * self) static gboolean usage_mode_to_action_state(GValue *value, GVariant *variant, - gpointer unused) + __attribute__((unused)) gpointer unused) { const gchar* usage_mode = g_variant_get_string(variant, NULL); GVariant* ret_var = g_variant_new_boolean(g_strcmp0(usage_mode, "Windowed") == 0 ? TRUE : FALSE); @@ -359,8 +359,8 @@ usage_mode_to_action_state(GValue *value, static GVariant* action_state_to_usage_mode(const GValue *value, - const GVariantType * unused_expected_type, - gpointer unused) + __attribute__((unused)) const GVariantType * unused_expected_type, + __attribute__((unused)) gpointer unused) { GVariant* var = g_value_get_variant(value); GVariant* ret = g_variant_new_string(g_variant_get_boolean(var) == TRUE ? "Windowed" : "Staged"); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f03b98e..44751ca 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -50,7 +50,6 @@ add_custom_target( add_executable (test-service test-service.cc) target_link_options(test-service PRIVATE -no-pie) -set_target_properties (test-service PROPERTIES COMPILE_FLAGS " -std=c++0x") add_test (test-service test-service) add_dependencies (test-service libayatanaindicatorsessionservice backendmock gschemas-compiled) target_link_libraries (test-service libayatanaindicatorsessionservice backendmock ${SERVICE_LIBRARIES} ${GTEST_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES}) diff --git a/tests/backend-dbus/CMakeLists.txt b/tests/backend-dbus/CMakeLists.txt index 93ffc45..92d5a02 100644 --- a/tests/backend-dbus/CMakeLists.txt +++ b/tests/backend-dbus/CMakeLists.txt @@ -1,5 +1,3 @@ -SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - # build desktopmock add_library (desktopmock STATIC mock-accounts.cc |