diff options
-rw-r--r-- | CMakeLists.txt | 21 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/backend-dbus/CMakeLists.txt | 2 |
3 files changed, 7 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7195c77..81428f2 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() add_definitions("-Wno-sign-compare") # Needed for GTest on Ubuntu @@ -49,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/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 |