aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanieri Althoff <ranisalt@gmail.com>2017-10-24 01:43:11 +0000
committerGitHub <noreply@github.com>2017-10-24 01:43:11 +0000
commit0d2baa1c89a845782cba37f62f6a7d38cfab6b62 (patch)
treef3b737ba214d90f402191c5c982bef61789bb551
parentb31b11f13969eba777a9cb3b100baef1f919efad (diff)
Use add_compile_options instead of interpolation
Uses CMake's `add_compile_options` directive instead of interpolating `CMAKE_C_FLAGS` for adding compilation flags.
-rw-r--r--CMakeLists.txt8
1 files changed, 2 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95f539e7..b253f1fc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,16 +2,12 @@ cmake_minimum_required(VERSION 3.1.0)
project(sway C)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
+add_compile_options(-g)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror)
list(INSERT CMAKE_MODULE_PATH 0
${CMAKE_CURRENT_SOURCE_DIR}/CMake