aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2022-01-14 13:50:32 +0100
committerRobert Tari <robert@tari.in>2022-01-14 14:03:27 +0100
commitb6278e2421712b04892001f8cf866a09580f309e (patch)
treebb3d66ad8980127cf63477532eadd48ef0539eeb
parentb340930ce0eaf467cdf007dbbc7a0e650eeadbf4 (diff)
downloadayatana-ido-b6278e2421712b04892001f8cf866a09580f309e.tar.gz
ayatana-ido-b6278e2421712b04892001f8cf866a09580f309e.tar.bz2
ayatana-ido-b6278e2421712b04892001f8cf866a09580f309e.zip
Clean up compilation flags
-rw-r--r--CMakeLists.txt22
-rw-r--r--example/CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--tests/CMakeLists.txt2
4 files changed, 10 insertions, 16 deletions
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"