Skip to content

Commit

Permalink
cmake: use CMAKE_C_FLAGS for flags, not add_definitions()
Browse files Browse the repository at this point in the history
  • Loading branch information
i-rinat committed Feb 25, 2018
1 parent ee09b29 commit 602b3a0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
project(apulse)
cmake_minimum_required (VERSION 2.8)
add_definitions(-std=gnu99 -Wall -fPIC -fvisibility=hidden)
add_definitions(-Werror=implicit-function-declaration)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -fPIC -fvisibility=hidden")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")

find_package(PkgConfig REQUIRED)

Expand All @@ -16,9 +18,6 @@ set(LOG_TO_STDERR 0 CACHE STRING "send all log output to stderr")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCONFIG_TRACE_LEVEL=${WITH_TRACE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCONFIG_LOG_TO_STDERR=${LOG_TO_STDERR}")

# link with pthread
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")

include_directories(${REQ_INCLUDE_DIRS})

set(USE_BUNDLED_PULSEAUDIO_HEADERS 1 CACHE BOOLEAN "Use bundled PulseAudio headers instead of system ones")
Expand Down

0 comments on commit 602b3a0

Please sign in to comment.