From 0ae2ec89845d2f22eab82f4bd43d5222a785ee6c Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 11 Feb 2022 14:25:31 +0100 Subject: Clean up compilation flags --- CMakeLists.txt | 22 +++++++--------------- src/CMakeLists.txt | 8 -------- tests/CMakeLists.txt | 2 -- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bb9042..ba6ebfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,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") +else() + add_definitions("-Wall") endif() ## @@ -107,19 +112,6 @@ add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 ## Actual building ## -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() - - include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories (${CMAKE_CURRENT_BINARY_DIR}/include) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5409c91..4131f22 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,13 +54,6 @@ if (ENABLE_LOMIRI_FEATURES) /usr/share/accountsservice/interfaces/com.lomiri.touch.AccountsService.Sound.xml) endif() -# add warnings/coverage info on handwritten files -# but not the autogenerated ones... -set_source_files_properties(${SERVICE_CXX_SOURCES} - PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -set_source_files_properties(${SERVICE_C_SOURCES} - PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) - # add the bin dir to our include path so our code can find the generated header files include_directories (${CMAKE_CURRENT_BINARY_DIR}) @@ -69,6 +62,5 @@ include_directories (${CMAKE_SOURCE_DIR}) link_directories (${SERVICE_DEPS_LIBRARY_DIRS}) add_executable (${SERVICE_EXEC} main.cpp) -set_source_files_properties(${SERVICE_SOURCES} main.cpp PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES}) install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 247761f..4b9b1d7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,5 @@ find_package(GMock REQUIRED) -SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS}") - # dbustest pkg_check_modules(DBUSTEST REQUIRED dbustest-1>=14.04.0) -- cgit v1.2.3 From e4b6f9ac3aead714e654418044dea504cfa04474 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 11 Feb 2022 14:51:07 +0100 Subject: .build.yml: Drop extra compilation flags --- .build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.build.yml b/.build.yml index 220f078..cba0170 100644 --- a/.build.yml +++ b/.build.yml @@ -226,7 +226,6 @@ before_scripts: build_scripts: - if [ ${DISTRO_NAME} == "debian" ];then - - export CFLAGS+=" -Wsign-compare -Wunused-parameter" - cppcheck --enable=warning,style,performance,portability,information --suppress=missingInclude . - fi - -- cgit v1.2.3