diff options
author | Robert Tari <robert@tari.in> | 2022-02-17 16:01:23 +0100 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2022-02-17 16:01:23 +0100 |
commit | 4b442de3f5fbb524dae7857dcc04afe020538f95 (patch) | |
tree | c03ebc4d6473bcedb94828f3337da24c95474fc8 | |
parent | 47244a91659255454778d0321cc4354201bbbb8a (diff) | |
download | libayatana-indicator-4b442de3f5fbb524dae7857dcc04afe020538f95.tar.gz libayatana-indicator-4b442de3f5fbb524dae7857dcc04afe020538f95.tar.bz2 libayatana-indicator-4b442de3f5fbb524dae7857dcc04afe020538f95.zip |
Clean up compilation flags
-rw-r--r-- | CMakeLists.txt | 29 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tools/CMakeLists.txt | 1 |
4 files changed, 11 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a13569..b5370ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,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() # Check for prerequisites @@ -45,14 +50,14 @@ set(DEPS ) if (FLAVOUR_GTK3) set(DEPS - ${DEPS} - gtk+-3.0>=3.24 + ${DEPS} + gtk+-3.0>=3.24 ) endif() if (FLAVOUR_GTK2) set(DEPS - ${DEPS} - gtk+-2.0>=2.18 + ${DEPS} + gtk+-2.0>=2.18 ) endif() @@ -81,18 +86,6 @@ set(API_VERSION "4") set(PROJECT_VERSION "0.9.0") set(PROJECT_NAME "libayatana-indicator") -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() - # Make everything add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9236617..ddb2fec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -133,7 +133,6 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-indicator-service.xml.c" ${GEN_INDIC # libayatana-indicator{,3}.so -set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) add_library("${ayatana_indicator_gtkver}" SHARED ${SOURCES}) set_target_properties("${ayatana_indicator_gtkver}" PROPERTIES VERSION ${ABI_VERSION}.0.0 SOVERSION ${ABI_VERSION}) target_compile_definitions("${ayatana_indicator_gtkver}" PUBLIC DG_LOG_DOMAIN="libayatana-indicator") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a299b65..cf84c55 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,7 +10,6 @@ find_program(DBUS_TEST_RUNNER dbus-test-runner) function(add_test_library_by_name name) set (TEST_LIBRARY_NAME ${name}) - set_source_files_properties(${TEST_LIBRARY_NAME}.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) add_library("${TEST_LIBRARY_NAME}" SHARED ${TEST_LIBRARY_NAME}.c) target_include_directories("${TEST_LIBRARY_NAME}" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) target_include_directories("${TEST_LIBRARY_NAME}" PUBLIC "${CMAKE_SOURCE_DIR}/src") @@ -21,7 +20,6 @@ endfunction() function(add_test_executable_by_name name) set (TEST_EXECUTABLE_NAME ${name}) - set_source_files_properties(${TEST_EXECUTABLE_NAME}.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) add_executable("${TEST_EXECUTABLE_NAME}" ${TEST_EXECUTABLE_NAME}.c) target_compile_definitions("${TEST_EXECUTABLE_NAME}" PUBLIC BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}") target_compile_definitions("${TEST_EXECUTABLE_NAME}" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") @@ -257,7 +255,6 @@ add_custom_command( add_test("loader-tester" "loader-tester") # indicator-test-service -set_source_files_properties(indicator-test-service.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) add_executable("indicator-test-service" indicator-test-service.c) target_include_directories("indicator-test-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) target_link_libraries("indicator-test-service" ${PROJECT_DEPS_LIBRARIES}) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 9027490..14ce777 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,7 +1,6 @@ if (FLAVOUR_GTK3 AND ENABLE_IDO) # ayatana-indicator-loader3 - set_source_files_properties(indicator-loader.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) add_executable("ayatana-indicator-loader3" indicator-loader.c) target_include_directories("ayatana-indicator-loader3" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) target_include_directories("ayatana-indicator-loader3" PUBLIC "${CMAKE_SOURCE_DIR}/src") |