aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.build.yml5
-rw-r--r--CMakeLists.txt22
-rw-r--r--src/CMakeLists.txt2
3 files changed, 9 insertions, 20 deletions
diff --git a/.build.yml b/.build.yml
index b748263b..14243060 100644
--- a/.build.yml
+++ b/.build.yml
@@ -86,15 +86,14 @@ before_scripts:
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 7af496b6..7185445b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,8 +22,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()
# GNU standard installation directories
@@ -49,21 +54,8 @@ add_custom_target (dist COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY
add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 --inline-suppr ${CMAKE_SOURCE_DIR}/src)
# Actual building
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Weverything")
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wno-c++98-compat -Wno-padded")
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wno-documentation")
-
-else()
-
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wall")
-
-endif()
-
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories (${CMAKE_CURRENT_BINARY_DIR}/include)
-
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(po)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e4ca3439..6a94756a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -17,7 +17,6 @@ install(TARGETS "ayatana-keyboard-lomiri" DESTINATION ${CMAKE_INSTALL_FULL_LIBDI
# libayatanaindicatorkeyboardservice.a
add_definitions(-DG_LOG_DOMAIN="ayatana-indicator-keyboard")
-set_source_files_properties(service.c PROPERTIES COMPILE_FLAGS "-std=c99")
add_library("ayatanaindicatorkeyboardservice" STATIC service.c)
include_directories(${CMAKE_SOURCE_DIR})
link_directories(${SERVICE_DEPS_LIBRARY_DIRS})
@@ -25,6 +24,5 @@ link_directories(${SERVICE_DEPS_LIBRARY_DIRS})
# ayatana-indicator-keyboard-service
add_executable("ayatana-indicator-keyboard-service" main.c)
-set_source_files_properties(service.c main.c PROPERTIES COMPILE_FLAGS "-std=c99")
target_link_libraries("ayatana-indicator-keyboard-service" "ayatanaindicatorkeyboardservice" "${SERVICE_DEPS_LIBRARIES} -ldl")
install(TARGETS "ayatana-indicator-keyboard-service" RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")