aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-01-27 09:59:16 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-01-27 09:59:16 +0100
commit854485a8e5aa0fc231825e732da53f6d6f0eb489 (patch)
treeaadc2ec00194bb08087b92e1f1ae1783314836cf
parentb340930ce0eaf467cdf007dbbc7a0e650eeadbf4 (diff)
parentaaf337b83f7e737248bfa6ecdb88b19ea6aae711 (diff)
downloadayatana-ido-854485a8e5aa0fc231825e732da53f6d6f0eb489.tar.gz
ayatana-ido-854485a8e5aa0fc231825e732da53f6d6f0eb489.tar.bz2
ayatana-ido-854485a8e5aa0fc231825e732da53f6d6f0eb489.zip
Merge branch 'tari01-pr/cleanup-compile-flags'
Attributes GH PR #57: https://github.com/AyatanaIndicators/ayatana-ido/pull/57
-rw-r--r--.build.yml5
-rw-r--r--CMakeLists.txt22
-rw-r--r--example/CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--tests/CMakeLists.txt2
5 files changed, 12 insertions, 19 deletions
diff --git a/.build.yml b/.build.yml
index 837dc50..2f95896 100644
--- a/.build.yml
+++ b/.build.yml
@@ -81,15 +81,14 @@ variables:
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 9f6cbff..81525a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,16 @@ else()
set(CMAKE_BUILD_TYPE "Release")
endif()
+if(ENABLE_WERROR)
+ add_definitions("-Werror")
+endif()
+
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_definitions("-Weverything")
+else()
+ add_definitions("-Wall")
+endif()
+
# Check for prerequisites
set(DEPS glib-2.0>=2.58 gtk+-3.0>=3.24)
@@ -39,18 +49,6 @@ pkg_check_modules(PROJECT_DEPS REQUIRED ${DEPS})
include(GNUInstallDirs)
set(PROJECT_VERSION "0.9.0")
-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/example/CMakeLists.txt b/example/CMakeLists.txt
index 52f7bde..95be390 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -1,6 +1,5 @@
# menus
-set_source_files_properties(menus.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
add_executable("menus" menus.c)
target_include_directories("menus" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
target_link_libraries("menus" ${PROJECT_DEPS_LIBRARIES} "-L${CMAKE_BINARY_DIR}/src" -layatana-ido3-0.4)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d0f023e..2f98b5d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -95,7 +95,6 @@ add_custom_command(
# ayatana-ido3-0.4.so
-set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
add_library("ayatana-ido3-0.4" SHARED ${SOURCES})
set_target_properties("ayatana-ido3-0.4" PROPERTIES VERSION 0.0.0 SOVERSION 0)
target_link_libraries("ayatana-ido3-0.4" ${PROJECT_DEPS_LIBRARIES})
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index eb6cff1..74a258f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,8 +7,6 @@ include_directories(
${PROJECT_DEPS_INCLUDE_DIRS}
)
-set_source_files_properties(gtest-menuitems.cpp PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
-
add_executable("gtest-menuitems" gtest-menuitems.cpp)
target_link_options("gtest-menuitems" PRIVATE -no-pie)
target_link_libraries("gtest-menuitems"