Skip to content

Commit 63936ec

Browse files
committed
Move -Wall CFLAGS to toplevel and change the way it works
This should let env CFLAGS override -O2 while forcing -Wall Signed-off-by: Hector Martin <hector@marcansoft.com>
1 parent f550f3a commit 63936ec

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
9191
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
9292
SET(DOC_OUTPUT_PATH ${CMAKE_BINARY_DIR}/doc)
9393

94+
# let CFLAGS env override this
95+
if(CMAKE_C_FLAGS STREQUAL "")
96+
set(CMAKE_C_FLAGS "-O2")
97+
endif()
98+
add_definitions(-Wall)
99+
94100
# Pretty much everyone is going to need the main includes
95101
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
96102

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
66

7-
set(CMAKE_C_FLAGS "-Wall")
87
include_directories(${LIBUSB_1_INCLUDE_DIRS})
98
LIST(APPEND SRC core.c tilt.c cameras.c usb_libusb10.c)
109

0 commit comments

Comments
 (0)