aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"