Browse Source

CMakeLists: fix build with old compilers

The libubootenv code uses some C99 constructs, but old compilers such
as gcc 4.7 don't default to -std=c99. This commit makes sure libubootenv
is built with -std=gnu99.

Fixes:

src/uboot_env.c:897:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
     for (int i = 0; i < strlen(pval); i++) {
     ^

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
pull/5/head
Pierre-Jean Texier' via swupdate 5 years ago
committed by Stefano Babic
parent
commit
3286c571c7
  1. 2
      CMakeLists.txt

2
CMakeLists.txt

@ -8,6 +8,8 @@ set(VERSION "0.1")
SET(SOVERSION "${VERSION}")
add_definitions(-DVERSION="${VERSION}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
#set(CMAKE_C_FLAGS_DEBUG "-g")
include_directories ("${PROJECT_SOURCE_DIR}/src")
add_subdirectory (src)

Loading…
Cancel
Save